rubensworks / ScholarMarkdown

A framework for writing markdown-based scholarly articles.
MIT License
41 stars 9 forks source link

Add CSS class snippets to wiki #5

Closed bjdmeest closed 6 years ago

bjdmeest commented 6 years ago

For myself, I'd think it would have been much easier to start with this if following snippets would have been included in https://github.com/rubensworks/ScholarMarkdown/wiki/Snippets

Using Custom visualizations: Kramdown

The default CSS (check shared.css) includes some custom visualization classes, useful for writing, such as marking TODO's, comments, and reviewing statements (spelling, grammar, rephrase, reference needed). As ScholarMarkdown supports Kramdown, you can add attributes via curly bracket notation ({:[options]}), so we can use these classes as follows:

for inline, the curly brackets need to come after an inline element (such as italic):

This is a paragraph.
_This sentence are badly grammared_{:.grammar}.
The evaluation shows that we are better in _X%_{:.todo} of the cases*.*{:.reference.needed}.

This will render as

<p>This is a paragraph.
<em class="grammar">This sentence are badly grammared</em>.
The evaluation shows that we are better in <em class="todo">X%</em> of the cases<em class="reference needed">.</em>.</p>

for block-level elements, the curly brackets need to come after a block-level element (such as a paragraph or blockquote):

This paragraph is done.

>{:.todo}
This blockquote needs some work

{:.todo}
This paragraph also isn't finished

This will render as

<p>This paragraph is done.</p>

<blockquote>
  <p class="todo">This blockquote needs some work</p>
</blockquote>

<p class="todo">This paragraph also isn’t finished</p>
rubensworks commented 6 years ago

Yes, the wiki can definitely be improved :-)

I'll try to incorporate your suggestion.

Or perhaps it might even be better to just include this as part of the quick-start guide...

bjdmeest commented 6 years ago

Ideally, I would like to see it in the initial generated content, and in the wiki :)

rubensworks commented 6 years ago

Updated the wiki based on your suggestion, thanks for the input!