-
Notifications
You must be signed in to change notification settings - Fork 38
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
caching issue with ids #51
Comments
Could just say to disable caching in general. |
Interesting, pandoc has support for identifiers https://pandoc.org/lua-filters.html#type-codeblock |
For now, I'm hacking slides.md and just adding space to the end of the codeblock in order to make each one unique. This later gets hashed (sha1) and used for the filename that is the key for the cache. |
I am not quite sure if I understand the problem: |
To solve these svg-id issues once and for all, I consider replacing my (too?) simple inlining solution (pandoc filter, written in Lua) with something that runs onLoad of the deck, like https://github.com/iconfu/svg-inject |
What do they say the 2 hardest problems in programming are? Variable naming, cache algorithms, and the off by one issue. I was always a fan of xhtml, and how the svg namespace could reside in it, with validation! I just used the python html5 validator to find all the dupe IDs. I'd lean towards keeping it embedded on the server side. I like being able to open a plain HTML file in the browser and not needing a web server. Though you can still use onLoad that way, I think. And you could still load references (src) to svg files. I think using pandoc lua plugins is fine. But maybe a node based webserver that calls PHP on the command line is overkill. When markdeck/pandoc calls a2sketch, does it have to be over http? Maybe markdeck can docker mount a volume that has the a2sketch php command. That's a different issue. Not to mention the php project is EOL. |
But in this case, the caching algorithm actually works... 🤔 And yes, both nodejs and php are not my first-choice languages, but until a few month ago a2sketch was rather on the markdeck periphery. So, it could need some overhaul/refactoring (when I am done with the markdeck issues)... |
Please give markdeck 0.54.2 a try: identical render_a2s code blocks should result in different svgs, thus avoiding the (non)unique-id-experience... |
I'm still getting disappearing svg paths. As I get more familiar with your system of components, I see there's caching. So here are my thoughts.
We should not force unique IDs, as I have done because break caching.
There should be a query string parameter on the IDs with the option to have no prefix, use a given prefix, or have svgo generate a random one.
slides.md could have syntax like this
If it's markdeck random, markdeck creates the id and passes it to a2sketch. Caching is enabled.
If it's a2sketch_random, a2sketch generates the id. Caching must be avoided.
Thoughts?
The text was updated successfully, but these errors were encountered: