Hi Juan, >> inline feedback,
On Mon, Jan 17, 2022 at 12:43 AM Juan Pablo Santos Rodríguez < juanpablo.san...@gmail.com> wrote: > Hi Dirk!, > > I've been looking at the source, and I'm not sure I'm following. > Wiki.Snip.js seems to be responsible of the wiki syntax displayed by > the editor, right? > >>> Yes, right. Wiki.Snip.js is the right file. (not the Snipe.Command.js) > > I was thinking of providing one Wiki.Snip.js via > wiki:IncludeResources. The specific file would be selected depending > on a property on jspwiki-custom.properties file, something like > > >>> That would be an option, but then you'd need to move the Wiki.Snip.js outside of the Haddock-edit.js file. (change the wro-haddock.xml build file) and load it separately. <% > final String editor = engine.getWikiProperties().get( > "jspwiki.syntax.editor" ); // or default to something > %> > [...] > <script type="text/javascript">//<![CDATA[ > <wiki:IncludeResources type="editor"/> > <%-- outputs something like > Wiki.Snips = {... } > --%> > //]]></script> > > In order to be loaded through wiki:IncludeResources, current > Wiki.Snip.js file would move to the jspwiki-main module, being > minified there; the jspwiki-markdown module would also hold a > Markdown.Wiki.Snip.js, following the same structure, but with Markdown > snippets. > > >>> Better is to keep it then separately; >>> In plain.jsp you could do this <wiki:RequestResource type="script" resource="scripts/haddock-edit.js" /> ->this is a reduced haddock-edit.js <c:if test="....this is normal editing session...."> <wiki:RequestResource type="script" resource="scripts/haddock-snips.js" /> <c:if> <c:if test="....this is a markdown editing session...."> <wiki:RequestResource type="script" resource="scripts/markdown-snips.js" /> </c:if> > Other 3rd party syntax extensions would hold their js file too, but > only one would be loaded, based on a property on > jspwiki-custom.properties file. This "pluggability" would be the > important thing to me when implementing support for other wiki > syntaxes, so there's no need to overwrite JSPs or provide templates > that overwrite a few JSPs for markdown (or other wiki syntaxes). > > That's was what I was heading, and I still have to make a POC to see > if this is feasible (I think it should, but have to make the POC). > > Re-reading your e-mail, it seems that your approach is different. > Given that you know way more on the editor / js in general, I feel > your approach is most probably the way to go. How would the wiki > syntax displayed by the editor be chosen? > >>> Alternatively, you could just leave the whole build unchanged. >>> And only load the markdown snippets on-top-of the defaults. Actually overwriting them. >>> In plain.jsp you could do this <wiki:RequestResource type="script" resource="scripts/haddock-edit.js" /> ->this is the full haddock-edit.js <c:if test="....this is a markdown editing session...."> <wiki:RequestResource type="script" resource="scripts/markdown-snips.js" /> </c:if> BR, dirk > best regards, > juan pablo > > On Fri, Jan 14, 2022 at 12:51 PM Dirk Frederickx > <dirk.frederi...@gmail.com> wrote: > > > > Hi Pablo, > > > > Good to see how this is progressing. > > > > Happy to help on building the markdown support into the editor. > > The SNIP editor is build to be pluggable, and this would be a good test > > case. > > You should only provide a specific "Markdown.Snipe.Command.js" file. > > > > Would you have a specific markdown editor JSP file or not ? > > > > > > BR, > > dirk > > > > On Thu, Jan 13, 2022 at 2:52 PM Juan Pablo Santos Rodríguez < > > juanpablo.san...@gmail.com> wrote: > > > > > Hi, > > > > > > last push completed markdown support on the WYIWYG editor. Right now > > > there's a markdown parser, a markdown renderer, a WYIWYG editor > > > renderer, and an html from the WYIWYG editor to markdown syntax > > > converter. [#1] has a bit more info on this. > > > > > > The only item left, in order to have full Markdown support inside > > > JSPWiki, is making the plain editor able to also output Markdown > > > syntax when using the "snips" functionality, but I have no idea on > > > what's the best way to accomodate this requirement. Right now the > > > aforementioned parser, renderers, etc. are pluggable, so if anyone > > > would want to write an extension to provide, say JIRA wiki markup > > > support, it is possible to do so. > > > > > > Ideally, markdown support on the plain editor should be pluggable as > > > well and allow third party wiki syntaxes. > > > > > > I've thought of providing the appropiate wiki syntax to the js files > > > the same way I18N texts are passed, using the IncludeResources tag on > > > the commonheader.jsp file, but I'm neither sure which files should be > > > provided, nor javascript is one of my strong suits. Or maybe if it > > > should be output a javascript object with the appropiate syntax, and > > > modify whatever js files are required to read the markup snips (or > > > whatever is needed) from this object? > > > > > > Dirk, WDYT? > > > > > > > > > best regards, > > > juan pablo > > > > > > [#1]: https://jspwiki-wiki.apache.org/Wiki.jsp?page=Markdown%20Support > > > >