Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add directive prototype * Add Figure directive, config, and fix lint * Monkey patch HR rule so that we can get away with `---` configs * Fix spelling * Split directives to own files and provide some fixes and enhancements - Directives should have the intelligence to know that a user specified a target of a span tag. If so, it should be treated with span logic. - Refactor so that raw tags are treated as atomic. - HTML directive should allow using a 'markdown' option to force markdown parsing or refuse markdown parsing (atomic). If not specified The directive will use normal tag logic to resolve. - If a directive was actually targeting a span element or atomic was being forced, revert fenced code to plain text. - Add more options to Figure * `type` is unnecessary parameter in Details and admonition The first class can serve as the type. Auto add it and auto provide a title if using a derivative note, etc. * Some fixes and cleanup * Handle the shorthand colon options as well. * Numerous changes - Require directives to spec parameters and generalize handling - Use pyyaml to parse inputs - Rework some of the internal flow * Each block under a directive calls `on_add` to allow different targets * Add on_parse event and fix argument spec on admonitions * Allow directives to declare they take no content or no more content * Adjust figure to work more like other implementations We do not currently implement `scale` as that would require us to depend on pulling in a full image dependency library. We may add it as an optional dependency. Meaning if you install Pillow, then it'll work, but if not, it will be rejected. * Add back on_end event and fix some parameter parsing * Fix parse blocks * Adjust type handling * Simplify some string handling - Ensure white space is not captured in args - No need for special YAML override - No need to strip strings in so many places * Don't convert string to boolean * Don't convert from string to ternary * Add ranged number types and type to test if string value in a list * Rework syntax - YAML dividers on config is optional - A blank line is required between directive header and content - Directive name does not require `{}` to wrap name in header - Argument(s) require a separator between directive name and argument(s) * Remove unnecessary parameter parsers * Add dedicated `attributes` option for HTML attributes on main element * Fix lint and logic of type_class * Add back in fenced code reversal The idea is that if we code is contained within a an atomic block or span that fenced code shouldn't have triggered anyways. This puts it back to the original source to be handled line inline content. Reverting in the case of span is probably debatable, but from a pure HTML perspective, it is the right call. We could potential relax this in the required later, but atomic should always do this. * Rename to "blocks" and change syntax to `/// name | optional string` * Handle scenario where there is no blank line before block start * Remove ability to define non-explicit options * Add some tests * Fix block class doc strings * Clean up dead code * more tests * Allow forcing mandatory YAML fences * backport tab select to new tab format * Add on register event and allow adding block specific configs * Add some updated tests * Admonitions can generate subclasses via a setting * Add the ability to use colon syntax or slash syntax and * Add some documentation for blocks * Update docs/src/markdown/extensions/blocks/index.md Fix typo Co-authored-by: Timothée Mazzucotelli <[email protected]> * Update docs/src/markdown/extensions/blocks/index.md fix typos Co-authored-by: Timothée Mazzucotelli <[email protected]> * Update docs/src/markdown/extensions/blocks/index.md Fix typos Co-authored-by: Timothée Mazzucotelli <[email protected]> * Fix tab related tests * Allow details to define shortcuts for types like admonitions * Some initial documentation for block meta-plugins * More consistent naming * Fix spelling * Updates to documentation * Fix raw block detection * Adjust tab examples * Add test for custom details and fix logic * Add a little bit more details on how meta-plugins are registered * Set alpha version * Add links to feedback discussion * Update changelog * Add missing discussion link to block page * Fix tab examples * Fix example renders * Config should not use YAML fences, but should instead use line tokens * Remove `require_yaml_fences` and fix some nesting issues. * Remove custom HR processors * Add support for indented YAML config and bump alpha version * Update documentation and tests * Fix lint * Ensure / can be escaped when blocks is registered * Update docs to reference new discussion * Document API * Make indentation the default options syntax and remove other approaches Tests had to be adjusted and it was found that legacy tabs were not actually outputting correctly, fix them so that they do operate as expected. Update documentation accordingly. * Remove outdated reference to yaml indentation option * Simplify argument logic, rename some things, and finish up API docs * Add definition plugin * Bump version * Update changelog * Update discussion links * Remove redundant type_string in docs and reorder some entries * Better phrasing of `on_mardown` return values * Further clarification of `on_init` * No plugins loaded by default and allow specifying plugins with strings * Switch parts of documents over to generic blocks and update Block API - Document missing config stuff. - Document tracking data across blocks. - Switch a number of parts over to generic blocks. - Add custom generic block tool for collapsible code blocks. * Fix tests after change that registers no blocks by default * More doc migrations to new generic blocks * Finish converting legacy containers over to new generic blocks in docs * Various attribute changes - HTML blocks use Emmet style tag and attribute defs - Blocks no longer define `attributes` option, but instead use `$` and take Emmet style attribute defs. - Admonitions and Details no longer define `type` attribute as it is redundant with using `$` to set a class. * Remove colon syntax * Update version and changelog * Add back `type` to Details and Admonition * Simplify block registration * Rename `$` option to `attrs` and revert back to dictionary of attributes * Abstract the way plugins work so they behave like normal md extensions * Update blocks and add type_any * Simplify argument API and update tests and docs * Update discussion link * Documentation fixes --------- Co-authored-by: Timothée Mazzucotelli <[email protected]>
- Loading branch information