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

Docs improvements: content in Markdown, organization into subtemplates, fixed tests #4401

Merged
merged 23 commits into from
Dec 16, 2016

Conversation

GeoffreyBooth
Copy link
Collaborator

More improvements to the documentation:

  • All the content is now markdown, compiled into HTML at build/template render time.
  • The code examples are compiled into JavaScript at build/template render time, without a step that creates intermediate .js files. The compilation is so fast that the disk writes were slower.
  • index.html now requires sub-templates, to divide content into relevant sub-files. The build process reassembles everything. The sub-files are mostly inside a documentation/v1 folder, giving the 2 docs source files a logical place to go.
  • index.html and test.html are now built via separate cake tasks, to avoid a gigantic function.
  • The browser-based tests run in test.html now run all the tests, including error_messages.coffee, thanks to a fixed polyfill for @throw.

lydell
lydell previously requested changes Dec 11, 2016
Copy link
Collaborator

@lydell lydell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this. Very much. Very well done!

</b>
"""
htmlFor = ->
marked = require 'marked'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be added to package.json,

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Are you okay with me merging this into develop whenever I'm done testing it? I'm working on getting the 2 docs built in their branch, based on this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Master, I mean.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, go for it!


All together now:

<table class="definitions">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we use CommonMark, then we could possibly write the tables in a more readable way. http://spec.commonmark.org/0.27/#html-blocks

What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that supported by the marked module? Its docs say to use this syntax: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#tables

I just haven't gotten around to converting, the automated HTML-to-Markdown converters I tried didn't support tables.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't realize you used an autmated converter.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that essentially treating the table as one big passthrough? But we still want markdown within the cells to be evaluated.

I would think the github style would be more idiomatic markdown than any form of HTML tags. It'll just take manual effort to convert.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There’s also the issue of rendering a headerless table in Markdown: markedjs/marked#484

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we only have two tables in total currently, so the way it is currently is not such a big deal. But if it could be made nicer in any way, that'd be great! 👍

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that can be a future improvement. You're welcome to try 😄

@jashkenas
Copy link
Owner

Very, very nice!

@tiye
Copy link

tiye commented Dec 13, 2016

Then it will cost less time to translate into Chinese. Great.

… docs can have different example code blocks/editors
…keywords and triple backticks (docs output is unchanged)
@GeoffreyBooth GeoffreyBooth merged commit e620434 into jashkenas:master Dec 16, 2016
@GeoffreyBooth GeoffreyBooth deleted the improve-docs branch December 16, 2016 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants