Skip to content
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

Add /docs directory for GitHub Pages #1138

Merged
merged 5 commits into from Mar 20, 2018
Merged

Add /docs directory for GitHub Pages #1138

merged 5 commits into from Mar 20, 2018

Conversation

styfle
Copy link
Member

@styfle styfle commented Mar 11, 2018

Description

  • move documentation to the /docs folder
  • create index.html page to serve as a landing page that "dogfoods" marked
  • trim down the main README.md
  • add logo to /docs/img directory
  • TODO: enable /docs to be root for GitHub Pages (needs to be setup by and admin)
  • TODO: add GitHub url to repo (needs to be setup by and admin)
  • TODO: change hyperlinks from master/docs/somepage.md to marked.js.org/somepage.md (needs to be setup by admin)

You can see this in action by visiting https://styfle.github.io/marked/

Contributor

  • no tests required for this PR.

Committer

In most cases, this should be a different person than the contributor.

  • CI is green (no forced merge required).
  • Merge PR

@styfle styfle added the category: docs Documentation changes label Mar 11, 2018
@@ -1,2 +1,3 @@
.git*
test/
docs
Copy link
Member Author

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
Copy link
Member Author

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>
Copy link
Member Author

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 {
Copy link
Member Author

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) {
Copy link
Member Author

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.

@styfle
Copy link
Member Author

styfle commented Mar 13, 2018

@markedjs/marked Did you all get a chance to review?

@UziTech
Copy link
Member

UziTech commented Mar 22, 2018

@joshbruce We should maybe get a new version published to NPM. Because of this PR a lot of the links on NPM are invalid.

@styfle
Copy link
Member Author

styfle commented Mar 22, 2018

Hmm, also the homepage in the package.json could be updated now that we have the marked.js.org domain.

@joshbruce
Copy link
Member

@UziTech and @styfle: See #1152

zhenalexfan pushed a commit to zhenalexfan/MarkdownHan that referenced this pull request Nov 8, 2021
Add /docs directory for GitHub Pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: docs Documentation changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants