-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add /docs directory for GitHub Pages #1138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -1,2 +1,3 @@ | |||
.git* | |||
test/ | |||
docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will prevent publishing the docs
directory to npm which is usually not advised.
</ul> | ||
|
||
<h2 id="marked">Marked</h2> | ||
# Marked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I greatly simplified the main README and moved the more complex one to /docs/README.md
</div> | ||
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/es6-promise/dist/es6-promise.js"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/unfetch/dist/unfetch.umd.js"></script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a polyfill for promise
and fetch
so hopefully this will work with older browsers 😸
<meta charset="utf-8"/> | ||
<title>Marked.js Documentation</title> | ||
<style> | ||
body { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some css styles that are similar to GitHub
var content = document.querySelector('#content'); | ||
var body = document.querySelector('html'); | ||
|
||
content.addEventListener('click', function (e) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I attach a click handler to the page so that any <a href="page.md">
will prevent default behavior of loading the page and instead fetch and render with marked.
@markedjs/marked Did you all get a chance to review? |
@joshbruce We should maybe get a new version published to NPM. Because of this PR a lot of the links on NPM are invalid. |
Hmm, also the homepage in the package.json could be updated now that we have the marked.js.org domain. |
Add /docs directory for GitHub Pages
Description
/docs
folderindex.html
page to serve as a landing page that "dogfoods" markedREADME.md
/docs/img
directory/docs
to be root for GitHub Pages (needs to be setup by and admin)master/docs/somepage.md
tomarked.js.org/somepage.md
(needs to be setup by admin)You can see this in action by visiting https://styfle.github.io/marked/
Contributor
Committer
In most cases, this should be a different person than the contributor.