-
Notifications
You must be signed in to change notification settings - Fork 9
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
Improve Markdown support #37
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The template filter uses the format <ktml:template:[format]></ktml:template:[format]> and is used to wrap a part of a template to be rendered using the engine matching the specified format.
Implement table of content filter that replaces <ktml:toc> with the table of contents of the pages using the page headings, by default the TOC will use h2 to h6. Behavior can be adapted using the 'base' and 'max' attributes, eg <ktml:toc max="2"> will only use
Add highlight.php to composer and Iimplement Atom One Light style. To use the code highlighter either use backticks in markdown, or use <pre><ode language="[language]"></code></pre>. If no language attribute exists the default language: php will be used.
- Add new anchor() method to the behavior template helper to inject the anchor library. - Load the anchor behavior if enabled (default is enabled) in the toc filter
Ensure that markdown filtering happens before highlighting
Changed tag syntax to <ktml:partial format="[format]"></ktml:partial>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Template Filters
Inline partial
To render an inline partial using a different format than the page format use the partial tag, format
<ktml:partial:[format]>[...]</ktml:partial:[format]>
. Example:Partial rendering is enabled by default and doesn't need to be added to the page filters.
Table of contents
Generate a table of contents (toc) from a page's HTML headers by adding a ktml:toc tag to the page. By default the TOC will use h1 to h6. The min and max headers can be configured using the min and max attributes.
<ktml:toc minx="2" max="4">
will only use the headings 2,3,4.Dynamic anchors are added to the header tags automatically using anchor.js.
Note: Table of contents filter needs to be enabled by adding the
toc
filter to theprocess:filters
list in the page frontmatter.Code highlighter
To use the code highlighter either use:
The default markdown approach using triple backtics
The advanced way using fenced code blocks. This is a feature of PHP Markdown Extra.
The html way using
<pre><ode class="[language]"></code></pre>
. The default language isphp
The highlighter is using the Atom One Light style
Note: Code highlighting needs to be enabled by adding the
highlight
filter to theprocess:filters
list in the page frontmatter.