Commit d029e61d authored by Sebastien Jourdain's avatar Sebastien Jourdain

Add media-wiki documentation generator

Change-Id: Ib3eb86c89653085116d2a5a756c62bacd6919cc6
parent 88ced97f
......@@ -341,6 +341,7 @@ function (generate_htmls_from_xmls output_files xmls gui_xmls output_dir)
-Dxmlpatterns:FILEPATH=${QT_XMLPATTERNS_EXECUTABLE}
-Dxml_to_xml_xsl:FILEPATH=${ParaView_CMAKE_DIR}/smxml_to_xml.xsl
-Dxml_to_html_xsl:FILEPATH=${ParaView_CMAKE_DIR}/xml_to_html.xsl
-Dxml_to_wiki_xsl:FILEPATH=${ParaView_CMAKE_DIR}/xml_to_wiki.xsl.in
-Dinput_xmls:STRING=${xmls_string}
-Dinput_gui_xmls:STRING=${gui_xmls_string}
-Doutput_dir:PATH=${output_dir}
......
......@@ -6,6 +6,7 @@ cmake_minimum_required(VERSION 2.8)
# xmlpatterns :- xmlpatterns executable.
# xml_to_xml_xsl :- xsl file to convert SM xml to internal xml Model.
# xml_to_html_xsl :- xsl file to conevrt the internal xml to html.
# xml_to_wiki_xsl :- xsl file to conevrt the internal xml to wiki.
# input_xmls :- + separated list of SM xml files
# input_gui_xmls :- + separated list of GUI xml files used to generate the
# CatergoryIndex.html
......@@ -80,3 +81,25 @@ foreach (single_html ${multiple_htmls_as_list})
file (WRITE "${output_dir}/${filename}" "${single_html}")
endif()
endforeach()
# ----------- WIKI -----------
# process the temporary.xml using the thrird XSL to generate a wiki content
set(wiki_sections sources filters writers)
foreach(wiki_section ${wiki_sections})
message("Processing wiki ${wiki_section}")
set(GROUP ${wiki_section})
set(tmp_wiki_xsl ${CMAKE_CURRENT_BINARY_DIR}/${wiki_section}_xml_to_wiki.xsl)
set(wiki_file ${output_dir}/${wiki_section}.wiki)
CONFIGURE_FILE(
${xml_to_wiki_xsl}
${tmp_wiki_xsl}
@ONLY IMMEDIATE)
execute_process(
COMMAND "${xmlpatterns}"
"${tmp_wiki_xsl}"
"${output_file}"
OUTPUT_VARIABLE wiki_content)
string (REGEX REPLACE " +" " " wiki_content "${wiki_content}")
string (REGEX REPLACE "\n " "\n" wiki_content "${wiki_content}")
file (WRITE "${wiki_file}" "${wiki_content}")
endforeach()
<?xml version="1.0" encoding="utf8"?>
<!-- Used to convert XML DOM generated from smxml_to_xml.xsl to Wiki -->
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/xml">
<xsl:for-each select="proxy[group='@GROUP@']">
==<xsl:value-of select="label" />==
<xsl:value-of select="documentation/brief" />
<xsl:value-of select="documentation/long" />
{| class="PropertiesTable" border="1" cellpadding="5"
|-
| '''Property'''
| '''Description'''
| '''Default Value(s)'''
| '''Restrictions'''
<xsl:for-each select="property">
|-
|'''<xsl:value-of select="label" />''' (<xsl:value-of select="name" />)
|
<xsl:value-of select="documentation/long" />
|
<xsl:value-of select="defaults" />
|
<xsl:for-each select="domains/domain">
<xsl:value-of select="text"/>
<xsl:for-each select="list" >
<xsl:for-each select="item">
* <xsl:value-of select="."/>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
|}
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment