You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jspwiki.apache.org by Archan Ranade <ar...@opshub.com> on 2021/10/05 10:26:11 UTC

Converting JSPWiki to HTML

Hi,

Please let me know how to convert JSPWiki to HTML as a standalone utility? I do not want to deploy the JSPWiki to a Tomcat server. Instead, I want to achieve the functionality of converting JSPWiki to HTML through a main program as a standalone utility. Please let me know how to do this. The other way around seems simple enough by using HtmlStringToWikiTranslator for HTML to JSPWiki conversion. Please let me know how to do JSPWiki to HTML.


Thanks,
Archan Ranade

[Logo]<https://www.opshub.com/>

Archan Ranade | Software Engineer

e: archan.ranade@opshub.com<ma...@opshub.com>  | w: https://www.opshub.com/
p:  +1.650.701.1800

[facebook icon]<https://www.facebook.com/OpsHub/> [twitter icon] <https://twitter.com/opshub/>  [youtube icon] <https://www.youtube.com/channel/UCuUvJx7xB1vQDRf6w8VwKIw?view_as=subscriber>  [linkedin icon] <https://www.linkedin.com/company/opshub>



Re: Converting JSPWiki to HTML

Posted by Juan Pablo Santos Rodríguez <ju...@gmail.com>.
Hi,

you can also use a RenderingManager + MarkupParser, you can see an example
at [#1]. Note that wiki markup may contain
plugins, acls, variables, etc., tldr: you'll need a running WikiEngine to
do the wiki -> html conversion. If you need to run this
conversion on a standalone basis, the TestEngine from the
org.apache.jspwiki:jspwiki-main:LATEST:test-jar artifact may be
suitable for this task; although it's meant to ease testing, nothing stops
you to use it on a standalone application. You can
see some doc on how to use it at [#2].

On a related note, and similar to this, you can also use JSPWiki to perform
markdown -> html conversion, see markdown
renderer tests at [#3].


HTH,
juan pablo

[#1]:
https://github.com/apache/jspwiki/blob/master/jspwiki-main/src/test/java/org/apache/wiki/render/RenderingManagerTest.java#L118-L126
[#2]:
https://jspwiki-wiki.apache.org/Wiki.jsp?page=JSPWikiPublicAPI#section-JSPWikiPublicAPI-Testing
[#3]:
https://github.com/apache/jspwiki/blob/master/jspwiki-markdown/src/test/java/org/apache/wiki/render/markdown/MarkdownRendererTest.java#L305

On Tue, Oct 5, 2021 at 11:10 PM Jürgen Weber <ju...@jwi.de> wrote:

> There is
>
>
> https://jspwiki.apache.org/apidocs/2.11.0.M4/org/apache/wiki/WikiEngine.html#getHTML-java.lang.String-
>
> Guess you could add a servlet/service/tag to JSPWiki that calls it
>
> Am Di., 5. Okt. 2021 um 12:27 Uhr schrieb Archan Ranade
> <ar...@opshub.com>:
> >
> > Hi,
> >
> > Please let me know how to convert JSPWiki to HTML as a standalone
> utility? I do not want to deploy the JSPWiki to a Tomcat server. Instead, I
> want to achieve the functionality of converting JSPWiki to HTML through a
> main program as a standalone utility. Please let me know how to do this.
> The other way around seems simple enough by using
> HtmlStringToWikiTranslator for HTML to JSPWiki conversion. Please let me
> know how to do JSPWiki to HTML.
> >
> >
> > Thanks,
> > Archan Ranade
> >
> > [Logo]<https://www.opshub.com/>
> >
> > Archan Ranade | Software Engineer
> >
> > e: archan.ranade@opshub.com<ma...@opshub.com>  | w:
> https://www.opshub.com/
> > p:  +1.650.701.1800
> >
> > [facebook icon]<https://www.facebook.com/OpsHub/> [twitter icon] <
> https://twitter.com/opshub/>  [youtube icon] <
> https://www.youtube.com/channel/UCuUvJx7xB1vQDRf6w8VwKIw?view_as=subscriber>
> [linkedin icon] <https://www.linkedin.com/company/opshub>
> >
> >
>

Re: Converting JSPWiki to HTML

Posted by Jürgen Weber <ju...@jwi.de>.
There is

https://jspwiki.apache.org/apidocs/2.11.0.M4/org/apache/wiki/WikiEngine.html#getHTML-java.lang.String-

Guess you could add a servlet/service/tag to JSPWiki that calls it

Am Di., 5. Okt. 2021 um 12:27 Uhr schrieb Archan Ranade
<ar...@opshub.com>:
>
> Hi,
>
> Please let me know how to convert JSPWiki to HTML as a standalone utility? I do not want to deploy the JSPWiki to a Tomcat server. Instead, I want to achieve the functionality of converting JSPWiki to HTML through a main program as a standalone utility. Please let me know how to do this. The other way around seems simple enough by using HtmlStringToWikiTranslator for HTML to JSPWiki conversion. Please let me know how to do JSPWiki to HTML.
>
>
> Thanks,
> Archan Ranade
>
> [Logo]<https://www.opshub.com/>
>
> Archan Ranade | Software Engineer
>
> e: archan.ranade@opshub.com<ma...@opshub.com>  | w: https://www.opshub.com/
> p:  +1.650.701.1800
>
> [facebook icon]<https://www.facebook.com/OpsHub/> [twitter icon] <https://twitter.com/opshub/>  [youtube icon] <https://www.youtube.com/channel/UCuUvJx7xB1vQDRf6w8VwKIw?view_as=subscriber>  [linkedin icon] <https://www.linkedin.com/company/opshub>
>
>

Re: Converting JSPWiki to HTML

Posted by Roland Whitehead <ro...@quru.com>.
On 05/10/2021 at 11:26, Archan Ranade wrote:
> Please let me know how to convert JSPWiki to HTML as a standalone utility? I do not want to deploy the JSPWiki to a Tomcat server. Instead, I want to achieve the functionality of converting JSPWiki to HTML through a main program as a standalone utility. Please let me know how to do this. The other way around seems simple enough by using HtmlStringToWikiTranslator for HTML to JSPWiki conversion. Please let me know how to do JSPWiki to HTML.

I replicated a JSPWiki site to static pages for public access with a 
simple shell script on a cron task. The shell script ran "wget" to get a 
clone of the site complete with any embedded images etc and then ran a 
set of "sed" tasks to remove things like log in links and anything that 
wasn't necessary for access. I don't have the script any more but it 
wasn't hard to write and should be done in 20 minutes or so even with 
multiple guesses/web searches for the sed parameters... Does rather 
require that this is running on a *nix based system and not Windows...

Shout if you want some more pointers.


Roland Whitehead