-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Introduce vocabulary parameter to wikitext content type #345
Comments
I just want to comment on the "cascade" part. I think I would find this useful for rules in general (maybe it is already possible?). I've actually been wondering how feasible it would be to extend the existing rules rather than replace through plug-ins. For instance, I have one Wiki where I want any all capitalized words to be auto links in addition to the standard rules. I've also thought about having a list of "magic" words that would always get auto links, etc... |
@davidjade yup, this proposal would meet your needs. The regexp for wikilink matching could be one of the vocab configuration parameters. |
So this would be set per-tiddler though? Seems like maybe I'd still need a plug-in approach if I wanted to extend the wikilink rules for all tiddlers (new and existing)? |
The vocabulary setting would be part of the "type" field of each tiddler. For example:
There would also be a way of setting the default vocabulary for new tiddlers. If you wanted to change the wikitext rules applied to a tiddler overriding the vocabulary specified within the type, then, yes, maybe that would need a plugin. The primary motivation for all of this is to enable interoperability of content. |
I have Written a simple framework, based on cascading settings (from our discussion). Only the overall structure is defined, along with the methods to combine a cascade of these structures, the result being passed to the parser. In addition I have extended the framework to include preparsers with the inclusion of "preparser":"..." within the Stid. It has the form "preparser":"text/xtext/y" where B is an (optional) Stid, that modifies the (pre)parser text/x and text/y is the form of the output of the preparser that is pass thru to the next parser in the cascade. Some examples are demoed here: |
very interesting |
@buggyj @Jermolene |
@buggyj many thanks, looks very interesting. I'll study it and provide feedback. @pmario the parameter syntax I'm suggesting is discussed here: http://tools.ietf.org/html/rfc6838#section-4.3 I found this StackOverflow article which gives some examples: |
@buggyj I wonder if it's worth making this into a pull request so that we can use the line commenting feature to discuss the implementation? |
@buggyj there are some issues with coding styles (eg TW5 always uses braces with the if statement). I've started trying to record the house style here: http://tiddlywiki.com/static/TiddlyWiki%2520Coding%2520Style%2520Guidelines.html |
yes it says:
and http://www.iana.org/assignments/media-types/media-types.xhtml which links to some mime types with parameters http://www.iana.org/assignments/media-types-parameters/media-types-parameters.xhtml so imo this will be ok.
but not recomended as seen here: http://tools.ietf.org/html/rfc6838#section-4.3
The StackOverflow article referes to http://tools.ietf.org/html/rfc2045 which is the specification for HTTP header types. ... Where http://tools.ietf.org/html/rfc6838#section-4.3 says: ``
So may be it would be best to have a mime subtype that tells a user, to have a look at special tiddler fields. eg: vocab=....
|
I did find a text vnd format: so for me it seems:
would be possible but the syntax of the parameter has to be specified. since http://tools.ietf.org/html/rfc6838#section-4.3 uses a MUST for the parameter specification. ... So we need to restrict the tiddler names, that can contain the vocab definitions. Otherwise it may be complicated.
|
@Jermolene |
Hi @buggyj no problem about coding standards, just wanted to make sure you were aware. I'd like to be able to discuss the code before you get stuck into lots of work on it, so I'd be happy for you to make a pull request in it's present form, and then we can bash it into shape. Many thanks! |
@Jermolene |
@Jermolene |
My apologies @buggyj I've been fighting a ridiculous backlog for a few days now. I've made a few comments on the pull request; I'm not sure that I understand all of the changes properly. My conclusion from a brief review is that in order to sort this issue out we need to do a more thorough refactoring of the parser architecture. There's a few problems I'd like to sort out in one go:
Anyhow, there's some other stuff on the roadmap I'd like to get done first (eg the current work on autosave and translation), and then return to this in a few weeks. |
simplified and resubmitted as pull request #629 |
@buggyj |
* Ignore parser rule configuration in safe mode * Made text translatable * Added new setting for camelcase links * Added warning on parser rule configuration tab See #1875
I like that idea a lot. Maybe instead of "vocab", this could be called "xmlns" or namespace, to follow the html spec ? |
"namespace" might work, but seems a little technical. I think of these vocabularies as being very visible for end users. The dream would be that we'd evolve vocabularies for specific niches (eg a vocabulary for dance choregraphers that incorporates a notation for dance moves, or a special vocabulary for writing D&D games). |
To aid in the interchange of content, it is proposed that we introduce a parameter to the TiddlyWiki5 content type (
text/vnd.tiddlywiki
) to specify the vocabulary with which the text is intended to be parsed. For example:A vocabulary specified via a URL:
A vocabulary defined in a local tiddler:
In either case, the vocabulary contains information specifying:
It might be useful for vocabularies to be able to cascade, so that one could describe a custom vocab as, say, "standard TW markup plus these three plugins".
The text was updated successfully, but these errors were encountered: