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

tinkr 0.3.0 roadmap #109

Open
9 of 14 tasks
zkamvar opened this issue May 9, 2024 · 0 comments
Open
9 of 14 tasks

tinkr 0.3.0 roadmap #109

zkamvar opened this issue May 9, 2024 · 0 comments

Comments

@zkamvar
Copy link
Member

zkamvar commented May 9, 2024

I am planning to do a major version component update to {tinkr} in the next few weeks with some new features and bug fixes. This describes my ambitions for it.

DOCUMENTATION

BUG FIXES

NEW FEATURES

Upstream Commonmark features

misc

  • find_between_nodes() will return a set of nodes that exist between two nodes in the same block. This will be most useful for finding the content between braces.
  • new methods to add markdown to specific places in the document (create append_md and prepend_md methods #119)

xml to markdown conversion/display

As of {tinkr} 0.2.0, it's not easy to convert a single XML node or set of nodes to markdown without converting the entire document. The following new features will help with that

Safeguards against upcoming changes to "asis" nodes

Version 1.0.0 will subtly break the way both {babeldown} and {pegboard} have been operating by using attributes to protect nodes instead of splitting them into "asis" nodes (see #105 and #107).

On the one hand, the "asis" nodes were useful because it allows patterns to find and protect nodes for translation:

  ## protect content inside curly braces and math ----
  woolish$body <- tinkr::protect_math(woolish$body)
  woolish$body <- tinkr::protect_curly(woolish$body)
  curlies <- xml2::xml_find_all(woolish$body, "//*[@curly]")
  purrr::walk(curlies, protect_curly)
  maths <- xml2::xml_find_all(woolish$body, "//*[@asis='true']")
  purrr::walk(maths, protect_math)

On the downside, it creates a bit of chaos because it does split up the nodes, as shown in the documentation for pegboard's internal fix_links():

However, if a link uses liquid templating for a variable such as: 
`[Home]({{ page.root }}/index.html) and other text`, it will appear in XML as

```xml
...
<text asis="true">[</text>
<text>Home</text>
<text asis="true">]</text>
<text>({{ page.root }}/index.html) and other text</text>
...
```

I want to add an accessor for protected nodes from the yarn object to help prepare for the change.

  • (add get_protected() #111) $get_protected() will return the protected nodes, which currently include curly, math, and square braces. The type and content of these nodes should not change when [Breaking Changes] attribute-based node protection #107 is merged.
    • this will have an argument of type, which will allow one or more of "curly", "math", and "square" to select the type of protected node to find. It defaults to NULL.
@zkamvar zkamvar pinned this issue May 22, 2024
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

No branches or pull requests

1 participant