dmulholl / shortcodes Goto Github PK
View Code? Open in Web Editor NEWA customizable shortcode parser in Python.
Home Page: http://www.dmulholl.com/dev/shortcodes.html
License: The Unlicense
A customizable shortcode parser in Python.
Home Page: http://www.dmulholl.com/dev/shortcodes.html
License: The Unlicense
Seems to have a missing step. Tried using it in django with the tags in a functions.py but the register doesn't seem to work or pick up the tags
The decode_escapes()
function breaks non-ASCII text. For example, decode_escapes('ü')
returns 'ü'
.
Tested on Python 3.6.3 on Ubuntu Linux.
hi,
first and foremost: thank you for working on this library.
while looking at the code (and integrating it into one of my django apps) i noticed that you except any kind of exception in AtomicShortcode and BlockShortcode with no possibility to opt-out from this behaviour.
imho you should’t catch exceptions at all at this point. in fact the way you handle them now even hides SyntaxError exceptions. in my case i wanted to raise a specific exception that is handled by one of the django middlewares. this is impossible because the exception in my shortcode is already handled by the render function in AtomicShortcode. all i have now is a RenderingError that doesn’t help much :).
i see a few options for resolving this:
if you tell me which option you prefer i may be able to submit a pull request :).
Would it be possible to support Python 2.7? I know it's almost deprecated, but there is some stuff running on it, and I can't imagine it being too hard to do using the six
module...
Hi,
First, thank you for making such a great library! It is the backbone of the Unprompted templating language for Stable Diffusion.
It has proven itself both flexible and reliable, however there is one limitation I've had to carefully work around: the inability to process an outermost shortcode first.
My project has evolved into a pseudo-programming language with conditional shortcodes like [if]
and [switch]
that, by design, must defer or outright skip processing of inner content.
Assuming this isn't already possible, I was hoping you could point me in the right direction for implementing such a change. I understand if it's not something you would implement yourself--my use case of the library is definitely unusual--but I'd appreciate your thoughts. Is it something that could be added without inverting the entire flow of parse()
?
Thanks!
Seems to have a missing step. Tried using it in django with the tags in a functions.py but the register doesn't seem to work or pick up the tags
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.