Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitad6c7f9

Browse files
authored
Merge pull request#1156 from UziTech/docs-navigation
Docs navigation
2 parentsf29bceb +9c01b83 commitad6c7f9

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

‎docs/README.md‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<ul>
22
<li><ahref="#marked">About</a></li>
3-
<li><ahref="#install">Installation</a></li>
3+
<li><ahref="#installation">Installation</a></li>
44
<li><ahref="#usage">Usage</a></li>
55
<li><ahref="#specifications">Supported Markdown specifications</a></li>
66
<li><ahref="#security">Security</a></li>
@@ -11,7 +11,7 @@
1111

1212
<h2id="marked">Marked</h2>
1313

14-
Marked is
14+
Marked is
1515

1616
1. built for speed.<sup>*</sup>
1717
2. a low-level markdown compiler that allows frequent parsing of large chunks of markdown without caching or blocking for long periods of time.<sup>**</sup>
@@ -96,4 +96,3 @@ For list of credited authors and contributors, please see our [authors page](AUT
9696
Copyright (c) 2011-2018, Christopher Jeffrey. (MIT License)
9797

9898
See[license](https://github.com/markedjs/marked/blob/master/LICENSE.md) for more details.
99-

‎docs/index.html‎

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
}
1313

1414
#container {
15+
position: relative;
1516
max-width:800px;
1617
margin: auto;
1718
padding:10px;
@@ -60,15 +61,28 @@
6061
background-color:rgba(27,31,35,0.05);
6162
border-radius:3px;
6263
}
64+
65+
.github-ribbon {
66+
position: absolute;
67+
top:0;
68+
right:0;
69+
border:0;
70+
}
6371
</style>
6472
</head>
6573
<body>
6674
<divid="container">
6775
<header>
68-
<imgsrc="img/logo-black.svg"height="64px"width="64px"/>
76+
<ahref="README.md">
77+
<imgsrc="img/logo-black.svg"height="64px"width="64px"/>
78+
</a>
6979
<h1>Marked.js Documentation</h1>
7080
</header>
71-
81+
82+
<ahref="https://github.com/markedjs/marked">
83+
<imgclass="github-ribbon"src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"alt="Fork me on GitHub">
84+
</a>
85+
7286
<divid="content"></div>
7387
</div>
7488
<scriptsrc="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
@@ -78,14 +92,15 @@ <h1>Marked.js Documentation</h1>
7892
varcontent=document.querySelector('#content');
7993
varbody=document.querySelector('html');
8094

81-
content.addEventListener('click',function(e){
82-
vara=e.target;
83-
if(a.tagName.toLowerCase()==='a'&&a.href.indexOf(location.origin)===0){
95+
body.addEventListener('click',function(e){
96+
vara=e.target.closest('a');
97+
if(a&&a.href.indexOf(location.origin)===0){
8498
varpage=a.href.slice(location.origin.length+location.pathname.length);
8599
if(page.slice(-3)==='.md'){
86100
e.preventDefault();
87101
fetchPage(page);
88102
}
103+
history.replaceState("",document.title,"/");
89104
}
90105
},false);
91106

@@ -100,8 +115,8 @@ <h1>Marked.js Documentation</h1>
100115
+'<p>'+e.message+'</p>';
101116
});
102117
}
103-
118+
104119
fetchPage('README.md');
105120
</script>
106121
</body>
107-
</html>
122+
</html>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp