mirror of https://github.com/lawrancej/logisim.git
Revised building scripts to match new documentation hierarchy and to generate contents.xml, doc.hs, and map.jhm for each language automatically.
git-svn-id: https://circuit.svn.sourceforge.net/svnroot/circuit/trunk@141 70edf91d-0b9e-4248-82e7-2488d7716404
This commit is contained in:
parent
29373e8b2b
commit
b17e60b9f8
|
@ -0,0 +1,161 @@
|
|||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE toc
|
||||
PUBLIC
|
||||
"-//Sun Microsystems Inc.//DTD
|
||||
JavaHelp TOC Version 2.0//EN"
|
||||
"http://java.sun.com/products/javahelp/toc_2_0.dtd">
|
||||
<toc version="2.0" categoryclosedimage="chapter" topicimage="topic">
|
||||
<tocitem image="toplevelfolder" target="top">
|
||||
|
||||
<tocitem target="guide">
|
||||
<tocitem target="tutorial">
|
||||
<tocitem target="tutorial_orient" />
|
||||
<tocitem target="tutorial_gates" />
|
||||
<tocitem target="tutorial_wires" />
|
||||
<tocitem target="tutorial_text" />
|
||||
<tocitem target="tutorial_test" />
|
||||
</tocitem>
|
||||
<tocitem target="attrlib">
|
||||
<tocitem target="attrlib_explore" />
|
||||
<tocitem target="attrlib_attr" />
|
||||
<tocitem target="attrlib_tool" />
|
||||
</tocitem>
|
||||
<tocitem target="subcirc">
|
||||
<tocitem target="subcirc_creating" />
|
||||
<tocitem target="subcirc_using" />
|
||||
<tocitem target="subcirc_appear" />
|
||||
<tocitem target="subcirc_debug" />
|
||||
<tocitem target="subcirc_library" />
|
||||
</tocitem>
|
||||
<tocitem target="bundles">
|
||||
<tocitem target="bundles_creating" />
|
||||
<tocitem target="bundles_splitting" />
|
||||
<tocitem target="bundles_colors" />
|
||||
</tocitem>
|
||||
<tocitem target="analyze">
|
||||
<tocitem target="analyze_open" />
|
||||
<tocitem target="analyze_table" />
|
||||
<tocitem target="analyze_expr" />
|
||||
<tocitem target="analyze_gen" />
|
||||
</tocitem>
|
||||
<tocitem target="menu">
|
||||
<tocitem target="menu_file" />
|
||||
<tocitem target="menu_edit" />
|
||||
<tocitem target="menu_project" />
|
||||
<tocitem target="menu_simulate" />
|
||||
<tocitem target="menu_winhelp" />
|
||||
</tocitem>
|
||||
<tocitem target="mem_guide">
|
||||
<tocitem target="mem_poke" />
|
||||
<tocitem target="mem_menu" />
|
||||
<tocitem target="mem_hex" />
|
||||
</tocitem>
|
||||
<tocitem target="log">
|
||||
<tocitem target="log_selection" />
|
||||
<tocitem target="log_table" />
|
||||
<tocitem target="log_file" />
|
||||
</tocitem>
|
||||
<tocitem target="verify">
|
||||
<tocitem target="verify_sub" />
|
||||
<tocitem target="verify_other" />
|
||||
<tocitem target="verify_multi" />
|
||||
</tocitem>
|
||||
<tocitem target="prefs">
|
||||
<tocitem target="prefs_template" />
|
||||
<tocitem target="prefs_tools" />
|
||||
<tocitem target="prefs_intl" />
|
||||
<tocitem target="prefs_exp" />
|
||||
<tocitem target="prefs_cmdline" />
|
||||
</tocitem>
|
||||
<tocitem target="opts">
|
||||
<tocitem target="opts_canvas" />
|
||||
<tocitem target="opts_simulate" />
|
||||
<tocitem target="opts_toolbar" />
|
||||
<tocitem target="opts_mouse" />
|
||||
</tocitem>
|
||||
<tocitem target="prop">
|
||||
<tocitem target="prop_delays" />
|
||||
<tocitem target="prop_oscillate" />
|
||||
<tocitem target="prop_shortcome" />
|
||||
</tocitem>
|
||||
<tocitem target="jar">
|
||||
<tocitem target="jar_incr" />
|
||||
<tocitem target="jar_library" />
|
||||
<tocitem target="jar_simpctr" />
|
||||
<tocitem target="jar_counter" />
|
||||
<tocitem target="jar_guide" />
|
||||
</tocitem>
|
||||
<tocitem target="about">
|
||||
<tocitem target="about_gpl" />
|
||||
</tocitem>
|
||||
</tocitem>
|
||||
|
||||
<tocitem target="libs">
|
||||
<tocitem target="base">
|
||||
<tocitem target="base_poke" />
|
||||
<tocitem target="base_edit" />
|
||||
<tocitem target="base_select" />
|
||||
<tocitem target="base_wiring" />
|
||||
<tocitem target="base_text" />
|
||||
<tocitem target="base_menu" />
|
||||
<tocitem target="base_splitter" />
|
||||
<tocitem target="base_pin" />
|
||||
<tocitem target="base_tunnel" />
|
||||
<tocitem target="base_pull" />
|
||||
<tocitem target="base_probe" />
|
||||
<tocitem target="base_clock" />
|
||||
<tocitem target="base_extender" />
|
||||
<tocitem target="base_label" />
|
||||
</tocitem>
|
||||
<tocitem target="gates">
|
||||
<tocitem target="gates_constant" />
|
||||
<tocitem target="gates_not" />
|
||||
<tocitem target="gates_buffer" />
|
||||
<tocitem target="gates_basic" />
|
||||
<tocitem target="gates_xor" />
|
||||
<tocitem target="gates_controlled" />
|
||||
</tocitem>
|
||||
<tocitem target="plexers">
|
||||
<tocitem target="plexers_mux" />
|
||||
<tocitem target="plexers_demux" />
|
||||
<tocitem target="plexers_decoder" />
|
||||
<tocitem target="plexers_priencod" />
|
||||
<tocitem target="plexers_selector" />
|
||||
</tocitem>
|
||||
<tocitem target="arith">
|
||||
<tocitem target="arith_adder" />
|
||||
<tocitem target="arith_subtractor" />
|
||||
<tocitem target="arith_multiplier" />
|
||||
<tocitem target="arith_divider" />
|
||||
<tocitem target="arith_negator" />
|
||||
<tocitem target="arith_comparator" />
|
||||
<tocitem target="arith_shifter" />
|
||||
<tocitem target="arith_bitadder" />
|
||||
<tocitem target="arith_bitfinder" />
|
||||
</tocitem>
|
||||
<tocitem target="mem">
|
||||
<tocitem target="mem_flipflops" />
|
||||
<tocitem target="mem_register" />
|
||||
<tocitem target="mem_counter" />
|
||||
<tocitem target="mem_shiftreg" />
|
||||
<tocitem target="mem_random" />
|
||||
<tocitem target="mem_ram" />
|
||||
<tocitem target="mem_rom" />
|
||||
</tocitem>
|
||||
<tocitem target="io">
|
||||
<tocitem target="io_button" />
|
||||
<tocitem target="io_joystick" />
|
||||
<tocitem target="io_keyboard" />
|
||||
<tocitem target="io_led" />
|
||||
<tocitem target="io_7seg" />
|
||||
<tocitem target="io_hexdig" />
|
||||
<tocitem target="io_dotmat" />
|
||||
<tocitem target="io_tty" />
|
||||
</tocitem>
|
||||
<tocitem target="legacy">
|
||||
<tocitem target="legacy_flipflops" />
|
||||
<tocitem target="legacy_register" />
|
||||
</tocitem>
|
||||
</tocitem>
|
||||
</tocitem>
|
||||
</toc>
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version='1.0' encoding='ISO-8859-1' ?>
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE helpset
|
||||
PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN"
|
||||
"http://java.sun.com/products/javahelp/helpset_2_0.dtd">
|
||||
|
@ -9,24 +9,22 @@
|
|||
<!-- maps -->
|
||||
<maps>
|
||||
<homeID>top</homeID>
|
||||
<mapref location="map.jhm" />
|
||||
<mapref location="map_{lang}.jhm" />
|
||||
</maps>
|
||||
|
||||
<!-- views -->
|
||||
<view xml:lang="en" mergetype="javax.help.UniteAppendMerge">
|
||||
<view xml:lang="{lang}" mergetype="javax.help.UniteAppendMerge">
|
||||
<name>TOC</name>
|
||||
<label>Table Of Contents</label>
|
||||
<type>javax.help.TOCView</type>
|
||||
<data>contents.xml</data>
|
||||
<data>{lang}/contents.xml</data>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<name>Search</name>
|
||||
<label>Search</label>
|
||||
<type>javax.help.SearchView</type>
|
||||
<data engine="com.sun.java.help.search.DefaultSearchEngine">
|
||||
JavaHelpSearch
|
||||
</data>
|
||||
<data engine="com.sun.java.help.search.DefaultSearchEngine">search_lookup_{lang}</data>
|
||||
</view>
|
||||
|
||||
<view>
|
|
@ -1,161 +0,0 @@
|
|||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE toc
|
||||
PUBLIC
|
||||
"-//Sun Microsystems Inc.//DTD
|
||||
JavaHelp TOC Version 2.0//EN"
|
||||
"http://java.sun.com/products/javahelp/toc_2_0.dtd">
|
||||
<toc version="2.0" categoryclosedimage="chapter" topicimage="topic">
|
||||
<tocitem image="toplevelfolder" text="Logisim References" target="top">
|
||||
|
||||
<tocitem target="guide" text="Guide to Being a Logisim User">
|
||||
<tocitem target="tutorial" text="Beginner's tutorial">
|
||||
<tocitem target="tutorial_orient" text="Step 0: Orienting yourself" />
|
||||
<tocitem target="tutorial_gates" text="Step 1: Adding gates" />
|
||||
<tocitem target="tutorial_wires" text="Step 2: Adding wires" />
|
||||
<tocitem target="tutorial_text" text="Step 3: Adding text" />
|
||||
<tocitem target="tutorial_test" text="Step 4: Testing your circuit" />
|
||||
</tocitem>
|
||||
<tocitem target="attrlib" text="Libraries and attributes">
|
||||
<tocitem target="attrlib_explore" text="The explorer pane" />
|
||||
<tocitem target="attrlib_attr" text="The attribute table" />
|
||||
<tocitem target="attrlib_tool" text="Tool and component attributes" />
|
||||
</tocitem>
|
||||
<tocitem target="subcirc" text="Subcircuits">
|
||||
<tocitem target="subcirc_creating" text="Creating circuits" />
|
||||
<tocitem target="subcirc_using" text="Using subcircuits" />
|
||||
<tocitem target="subcirc_appear" text="Editing subcircuit appearance" />
|
||||
<tocitem target="subcirc_debug" text="Debugging subcircuits" />
|
||||
<tocitem target="subcirc_library" text="Logisim libraries" />
|
||||
</tocitem>
|
||||
<tocitem target="bundles" text="Wire bundles">
|
||||
<tocitem target="bundles_creating" text="Creating bundles" />
|
||||
<tocitem target="bundles_splitting" text="Splitters" />
|
||||
<tocitem target="bundles_colors" text="Wire colors" />
|
||||
</tocitem>
|
||||
<tocitem target="analyze" text="Combinational analysis">
|
||||
<tocitem target="analyze_open" text="Opening Combinational Analysis" />
|
||||
<tocitem target="analyze_table" text="Editing the truth table" />
|
||||
<tocitem target="analyze_expr" text="Creating expressions" />
|
||||
<tocitem target="analyze_gen" text="Generating a circuit" />
|
||||
</tocitem>
|
||||
<tocitem target="menu" text="Menu reference">
|
||||
<tocitem target="menu_file" text="The File menu" />
|
||||
<tocitem target="menu_edit" text="The Edit menu" />
|
||||
<tocitem target="menu_project" text="The Project menu" />
|
||||
<tocitem target="menu_simulate" text="The Simulate menu" />
|
||||
<tocitem target="menu_winhelp" text="The Window and Help menus" />
|
||||
</tocitem>
|
||||
<tocitem target="mem_guide" text="Memory components">
|
||||
<tocitem target="mem_poke" text="Poking memory" />
|
||||
<tocitem target="mem_menu" text="Pop-up menus and files" />
|
||||
<tocitem target="mem_hex" text="Hex editor" />
|
||||
</tocitem>
|
||||
<tocitem target="log" text="Logging">
|
||||
<tocitem target="log_selection" text="The Selection tab" />
|
||||
<tocitem target="log_table" text="The Table tab" />
|
||||
<tocitem target="log_file" text="The File tab" />
|
||||
</tocitem>
|
||||
<tocitem target="verify" text="Command-line verification">
|
||||
<tocitem target="verify_sub" text="Substituting libraries" />
|
||||
<tocitem target="verify_other" text="Other verification options" />
|
||||
<tocitem target="verify_multi" text="Testing multiple files" />
|
||||
</tocitem>
|
||||
<tocitem target="prefs" text="Application preferences">
|
||||
<tocitem target="prefs_template" text="The Template tab" />
|
||||
<tocitem target="prefs_tools" text="The Tools tab" />
|
||||
<tocitem target="prefs_intl" text="The International tab" />
|
||||
<tocitem target="prefs_exp" text="The Experimental tab" />
|
||||
<tocitem target="prefs_cmdline" text="The command line" />
|
||||
</tocitem>
|
||||
<tocitem target="opts" text="Project options">
|
||||
<tocitem target="opts_canvas" text="The Canvas tab" />
|
||||
<tocitem target="opts_simulate" text="The Simulation tab" />
|
||||
<tocitem target="opts_toolbar" text="The Toolbar tab" />
|
||||
<tocitem target="opts_mouse" text="The Mouse tab" />
|
||||
</tocitem>
|
||||
<tocitem target="prop" text="Value propagation">
|
||||
<tocitem target="prop_delays" text="Gate delays" />
|
||||
<tocitem target="prop_oscillate" text="Oscillation errors" />
|
||||
<tocitem target="prop_shortcome" text="Shortcomings" />
|
||||
</tocitem>
|
||||
<tocitem target="jar" text="JAR libraries">
|
||||
<tocitem target="jar_incr" text="Gray Code Incrementer" />
|
||||
<tocitem target="jar_library" text="Library Class" />
|
||||
<tocitem target="jar_simpctr" text="Simple Gray Code Counter" />
|
||||
<tocitem target="jar_counter" text="Gray Code Counter" />
|
||||
<tocitem target="jar_guide" text="Guidelines" />
|
||||
</tocitem>
|
||||
<tocitem target="about" text="About the program">
|
||||
<tocitem target="about_gpl" text="GNU General Public License" />
|
||||
</tocitem>
|
||||
</tocitem>
|
||||
|
||||
<tocitem target="libs" text="Library Reference">
|
||||
<tocitem target="base" text="Base library">
|
||||
<tocitem target="base_poke" text="Poke Tool" />
|
||||
<tocitem target="base_edit" text="Edit Tool" />
|
||||
<tocitem target="base_select" text="Select Tool" />
|
||||
<tocitem target="base_wiring" text="Wiring Tool" />
|
||||
<tocitem target="base_text" text="Text Tool" />
|
||||
<tocitem target="base_menu" text="Menu Tool" />
|
||||
<tocitem target="base_splitter" text="Splitter" />
|
||||
<tocitem target="base_pin" text="Pin" />
|
||||
<tocitem target="base_tunnel" text="Tunnel" />
|
||||
<tocitem target="base_pull" text="Pull Resistor" />
|
||||
<tocitem target="base_probe" text="Probe" />
|
||||
<tocitem target="base_clock" text="Clock" />
|
||||
<tocitem target="base_extender" text="Bit Extender" />
|
||||
<tocitem target="base_label" text="Text" />
|
||||
</tocitem>
|
||||
<tocitem target="gates" text="Gates library">
|
||||
<tocitem target="gates_constant" text="Constant" />
|
||||
<tocitem target="gates_not" text="NOT Gate" />
|
||||
<tocitem target="gates_buffer" text="Buffer" />
|
||||
<tocitem target="gates_basic" text="AND/OR/NAND/NOR Gate" />
|
||||
<tocitem target="gates_xor" text="XOR/XNOR/Even/Odd Gate" />
|
||||
<tocitem target="gates_controlled" text="Controlled Buffer/Inverter" />
|
||||
</tocitem>
|
||||
<tocitem target="plexers" text="Plexers library">
|
||||
<tocitem target="plexers_mux" text="Multiplexer" />
|
||||
<tocitem target="plexers_demux" text="Demultiplexer" />
|
||||
<tocitem target="plexers_decoder" text="Decoder" />
|
||||
<tocitem target="plexers_priencod" text="Priority Encoder" />
|
||||
<tocitem target="plexers_selector" text="Bit Selector" />
|
||||
</tocitem>
|
||||
<tocitem target="arith" text="Arithmetic library">
|
||||
<tocitem target="arith_adder" text="Adder" />
|
||||
<tocitem target="arith_subtractor" text="Subtractor" />
|
||||
<tocitem target="arith_multiplier" text="Multiplier" />
|
||||
<tocitem target="arith_divider" text="Divider" />
|
||||
<tocitem target="arith_negator" text="Negator" />
|
||||
<tocitem target="arith_comparator" text="Comparator" />
|
||||
<tocitem target="arith_shifter" text="Shifter" />
|
||||
<tocitem target="arith_bitadder" text="Bit Adder" />
|
||||
<tocitem target="arith_bitfinder" text="Bit Finder" />
|
||||
</tocitem>
|
||||
<tocitem target="mem" text="Memory library">
|
||||
<tocitem target="mem_flipflops" text="D/T/J-K/S-R Flip-Flop" />
|
||||
<tocitem target="mem_register" text="Register" />
|
||||
<tocitem target="mem_counter" text="Counter" />
|
||||
<tocitem target="mem_shiftreg" text="Shift Register" />
|
||||
<tocitem target="mem_random" text="Random" />
|
||||
<tocitem target="mem_ram" text="RAM" />
|
||||
<tocitem target="mem_rom" text="ROM" />
|
||||
</tocitem>
|
||||
<tocitem target="io" text="Input/Output library">
|
||||
<tocitem target="io_button" text="Button" />
|
||||
<tocitem target="io_joystick" text="Joystick" />
|
||||
<tocitem target="io_keyboard" text="Keyboard" />
|
||||
<tocitem target="io_led" text="LED" />
|
||||
<tocitem target="io_7seg" text="7-Segment Display" />
|
||||
<tocitem target="io_hexdig" text="Hex Digit Display" />
|
||||
<tocitem target="io_dotmat" text="LED Matrix" />
|
||||
<tocitem target="io_tty" text="TTY" />
|
||||
</tocitem>
|
||||
<tocitem target="legacy" text="Legacy library">
|
||||
<tocitem target="legacy_flipflops" text="Logisim 1.0 D/J-K Flip-Flop" />
|
||||
<tocitem target="legacy_register" text="Logisim 1.0 8-Bit Register" />
|
||||
</tocitem>
|
||||
</tocitem>
|
||||
</tocitem>
|
||||
</toc>
|
|
@ -1,69 +0,0 @@
|
|||
<?xml version='1.0' encoding='ISO-8859-1' ?>
|
||||
<!DOCTYPE helpset
|
||||
PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN"
|
||||
"http://java.sun.com/products/javahelp/helpset_2_0.dtd">
|
||||
<helpset version="2.0">
|
||||
<!-- title -->
|
||||
<title>Logisim - Help</title>
|
||||
|
||||
<!-- maps -->
|
||||
<maps>
|
||||
<homeID>top</homeID>
|
||||
<mapref location="map.jhm" />
|
||||
</maps>
|
||||
|
||||
<!-- views -->
|
||||
<view xml:lang="en" mergetype="javax.help.UniteAppendMerge">
|
||||
<name>TOC</name>
|
||||
<label>Table Of Contents</label>
|
||||
<type>javax.help.TOCView</type>
|
||||
<data>contents.xml</data>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<name>Search</name>
|
||||
<label>Search</label>
|
||||
<type>javax.help.SearchView</type>
|
||||
<data engine="com.sun.java.help.search.DefaultSearchEngine">
|
||||
JavaHelpSearch
|
||||
</data>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
<name>Favorites</name>
|
||||
<label>Favorites</label>
|
||||
<type>javax.help.FavoritesView</type>
|
||||
</view>
|
||||
|
||||
<!-- presentation windows -->
|
||||
|
||||
<!-- This window is the default one for the helpset.
|
||||
* Its title bar says "Logisim Help". It
|
||||
* is a tri-paned window because displayviews, not
|
||||
* defined, defaults to true and because a toolbar is defined.
|
||||
* The toolbar has a back arrow, a forward arrow, and
|
||||
* a home button that has a user-defined image.
|
||||
-->
|
||||
<presentation default=true>
|
||||
<name>main window</name>
|
||||
<size width="900" height="700" />
|
||||
<location x="200" y="10" />
|
||||
<title>Logisim Help</title>
|
||||
<toolbar>
|
||||
<helpaction>javax.help.BackAction</helpaction>
|
||||
<helpaction>javax.help.ForwardAction</helpaction>
|
||||
<helpaction image="homeicon">javax.help.HomeAction</helpaction>
|
||||
<helpaction>javax.help.SeparatorAction</helpaction>
|
||||
<helpaction>javax.help.FavoritesAction</helpaction>
|
||||
</toolbar>
|
||||
</presentation>
|
||||
|
||||
<!-- implementation section -->
|
||||
<impl>
|
||||
<helpsetregistry helpbrokerclass="javax.help.DefaultHelpBroker" />
|
||||
<viewerregistry viewertype="text/html"
|
||||
viewerclass="com.sun.java.help.impl.CustomKit" />
|
||||
<viewerregistry viewertype="text/xml"
|
||||
viewerclass="com.sun.java.help.impl.CustomXMLKit" />
|
||||
</impl>
|
||||
</helpset>
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
CHANGE LOG
|
||||
|
||||
Feature: If you go to the Preference window's Experimental tab and check "Show Tick Rate," Logisim will measure the actual speed that ticking occurs and display that in the canvas's upper right corner. For complex circuits, the circuit cannot be simulated at the selected tick rate, and so the measured tick rate can be much less.
|
||||
Feature: If you go to the Preference window's Experimental tab and check "Show Tick Rate," Logisim will measure the actual rate of ticks and display it in the canvas's upper right corner. For complex circuits, the circuit cannot be simulated at the faster rates listed in the Simulate menu, and so the measured tick rate can be much less than what the user has selected.
|
||||
|
||||
Feature: A first version of the German documentation is included.
|
||||
|
||||
|
@ -9,4 +9,4 @@ Bug fix: The tick rate would default to 1 KHz, although the initially checked ti
|
|||
|
||||
Bug fix: In editing the appearance and creating a rectangle, oval, or rounded rectangle, there would sometimes be artifacts left behind as the mouse was dragged.
|
||||
|
||||
Implementation change: The directory hierarchy of the documentation was changed to facilitate easier translation.
|
||||
Implementation change: The documentation's directory hierarchy was changed to facilitate easier translation.
|
|
@ -90,17 +90,21 @@ def _handle_tag(image_paths_xx, image_paths_en, cwd, xx_src, en_src):
|
|||
return ' '.join(pieces) + tag_end
|
||||
return handle_tag
|
||||
|
||||
def do_copy(src_dir, dst_dir):
|
||||
if not os.path.exists(dst_dir):
|
||||
os.mkdir(dst_dir)
|
||||
|
||||
en_src = build_path(src_dir, 'en')
|
||||
def _find_locales(src_dir, dst_dir):
|
||||
doc_locales = []
|
||||
for locale in os.listdir(src_dir):
|
||||
locale_src = build_path(src_dir, locale)
|
||||
locale_dst = build_path(dst_dir, locale)
|
||||
if len(locale) == 2 and os.path.isdir(locale_src):
|
||||
doc_locales.append((locale, locale_src, locale_dst))
|
||||
return doc_locales
|
||||
|
||||
def do_copy(src_dir, dst_dir):
|
||||
if not os.path.exists(dst_dir):
|
||||
os.mkdir(dst_dir)
|
||||
|
||||
en_src = build_path(src_dir, 'en')
|
||||
doc_locales = _find_locales(src_dir, dst_dir)
|
||||
|
||||
# Identify image files - first see which image files are unique to language
|
||||
image_paths = {}
|
||||
|
@ -139,11 +143,100 @@ def do_copy(src_dir, dst_dir):
|
|||
else:
|
||||
shutil.copy(file_src, file_dst)
|
||||
|
||||
def build_contents(src_dir, dst_dir):
|
||||
doc_locales = _find_locales(src_dir, dst_dir)
|
||||
|
||||
xn_ids = {}
|
||||
re_contents = re.compile('<a [^>]*id="([^"]*)">([^<]*)</a>')
|
||||
for locale, locale_src, locale_dst in doc_locales:
|
||||
for file in ['map.jhm', 'images/toplevel.gif',
|
||||
'images/topic.gif', 'images/chapTopic.gif']:
|
||||
file_dst = build_path(locale_dst, file)
|
||||
if (locale != 'en' and not os.path.exists(file_dst)
|
||||
and os.path.exists(os.path.dirname(file_dst))):
|
||||
file_src = build_path(en_src, file)
|
||||
shutil.copy(file_src, file_dst)
|
||||
contents_src = build_path(locale_src, 'html/contents.html')
|
||||
if os.path.exists(contents_src):
|
||||
with open(contents_src, encoding='utf-8') as contents_file:
|
||||
contents_text = contents_file.read()
|
||||
ids = {}
|
||||
for contents_id in re_contents.finditer(contents_text):
|
||||
id = contents_id.group(1)
|
||||
text = contents_id.group(2)
|
||||
text = text.replace('"', '"')
|
||||
ids[id] = text
|
||||
xn_ids[locale] = ids
|
||||
|
||||
base_path = build_path(src_dir, 'circs/base-contents.xml')
|
||||
with open(base_path, encoding='utf-8') as base_file:
|
||||
base_text = base_file.read();
|
||||
|
||||
re_tocitem = re.compile('(<tocitem[^>]*target=")([^"]*)(")([^>]*>)')
|
||||
for locale, locale_src, locale_dst in doc_locales:
|
||||
contents_dst = build_path(locale_dst, 'contents.xml')
|
||||
if not os.path.exists(contents_dst):
|
||||
def tocitem_repl(match):
|
||||
target_pre = match.group(1)
|
||||
target = match.group(2)
|
||||
target_post = match.group(3)
|
||||
tocitem_end = match.group(4)
|
||||
|
||||
if locale in xn_ids and target in xn_ids[locale]:
|
||||
text = ' text="' + xn_ids[locale][target] + '"'
|
||||
elif target in xn_ids['en']:
|
||||
text = ' text="' + xn_ids['en'][target] + '"'
|
||||
else:
|
||||
text = ''
|
||||
|
||||
return target_pre + target + target_post + text + tocitem_end
|
||||
|
||||
contents_text = re_tocitem.sub(tocitem_repl, base_text)
|
||||
with open(contents_dst, 'w', encoding='utf-8') as contents_file:
|
||||
contents_file.write(contents_text)
|
||||
|
||||
def build_map(src_dir, dst_dir):
|
||||
doc_locales = _find_locales(src_dir, dst_dir)
|
||||
|
||||
xn_urls = {}
|
||||
for locale, locale_src, locale_dst in doc_locales:
|
||||
urls = {}
|
||||
for path, dirs, files in os.walk(locale_src):
|
||||
if '.svn' in dirs:
|
||||
dirs.remove('.svn')
|
||||
for file in files:
|
||||
rel_path = os.path.relpath(build_path(path, file), locale_src)
|
||||
urls[rel_path.replace('\\', '/')] = True
|
||||
xn_urls[locale] = urls
|
||||
|
||||
base_map = build_path(src_dir, 'circs/base-map.jhm')
|
||||
with open(base_map, encoding='utf-8') as base_file:
|
||||
base_text = base_file.read();
|
||||
|
||||
re_mapid = re.compile('(<mapID[^>]*url=")([^"]*)("[^>]*>)')
|
||||
for locale, locale_src, locale_dst in doc_locales:
|
||||
map_dst = build_path(dst_dir, 'map_' + locale + '.jhm')
|
||||
if not os.path.exists(map_dst):
|
||||
def mapid_repl(match):
|
||||
url_pre = match.group(1)
|
||||
url = match.group(2)
|
||||
url_post = match.group(3)
|
||||
|
||||
if locale in xn_urls and url in xn_urls[locale]:
|
||||
url = locale + '/' + url
|
||||
elif url in xn_urls['en']:
|
||||
url = 'en/' + url
|
||||
|
||||
return url_pre + url + url_post
|
||||
|
||||
map_text = re_mapid.sub(mapid_repl, base_text)
|
||||
with open(map_dst, 'w', encoding='utf-8') as map_file:
|
||||
map_file.write(map_text)
|
||||
|
||||
def build_helpset(src_dir, dst_dir):
|
||||
doc_locales = _find_locales(src_dir, dst_dir)
|
||||
|
||||
base_helpset = build_path(src_dir, 'circs/base-doc.hs')
|
||||
with open(base_helpset, encoding='utf-8') as base_file:
|
||||
base_text = base_file.read();
|
||||
|
||||
re_lang = re.compile('{lang}')
|
||||
for locale, locale_src, locale_dst in doc_locales:
|
||||
helpset_dst = build_path(dst_dir, 'doc_' + locale + '.hs')
|
||||
if not os.path.exists(helpset_dst):
|
||||
helpset_text = re_lang.sub(locale, base_text)
|
||||
with open(helpset_dst, 'w', encoding='utf-8') as helpset_file:
|
||||
helpset_file.write(helpset_text)
|
||||
|
|
|
@ -224,19 +224,23 @@ if include_documentation:
|
|||
print('copying documentation')
|
||||
doc_dst = build_path(temp_dir, 'doc')
|
||||
copy_doc.do_copy(doc_dir, doc_dst)
|
||||
copy_doc.build_contents(doc_dir, doc_dst)
|
||||
copy_doc.build_map(doc_dir, doc_dst)
|
||||
copy_doc.build_helpset(doc_dir, doc_dst)
|
||||
|
||||
jhindexer = build_path(data_dir, 'javahelp/bin/jhindexer.jar', cygwin=False)
|
||||
os.chdir(doc_dst)
|
||||
for locale in os.listdir(doc_dst):
|
||||
locale_dst = build_path(doc_dst, locale)
|
||||
if os.path.isdir(locale_dst):
|
||||
os.chdir(locale_dst)
|
||||
cmd_args = [java_exec, '-jar', jhindexer]
|
||||
if os.path.exists('jhindexer.cfg'):
|
||||
cmd_args.extend(['-c', 'jhindexer.cfg'])
|
||||
cmd_args.extend(['-db', 'search_lookup_' + locale])
|
||||
cmd_args.extend(['-locale', locale])
|
||||
found = False
|
||||
for sub in ['guide', 'libs']:
|
||||
if os.path.exists(build_path(locale_dst, sub)):
|
||||
for sub in [locale + '/html/guide', locale + '/html/libs']:
|
||||
if os.path.exists(build_path(doc_dst, sub)):
|
||||
cmd_args.append(sub)
|
||||
found = True
|
||||
if found:
|
||||
|
|
|
@ -77,7 +77,7 @@ helpAboutItem= \u00dcber...
|
|||
helpNotFoundError= Hilfedaten nicht gefunden.
|
||||
helpUnavailableError= Konnte die Hilfedaten nicht laden.
|
||||
helpDisplayError= Konnte die Hilfedaten nicht anzeigen.
|
||||
helpsetUrl= doc/en/doc.hs
|
||||
helpsetUrl= doc/doc_de.hs
|
||||
#
|
||||
# Popups.java
|
||||
#
|
||||
|
|
|
@ -77,7 +77,7 @@ helpAboutItem = About...
|
|||
helpNotFoundError = Help data not found.
|
||||
helpUnavailableError = Could not load help data.
|
||||
helpDisplayError = Could not display help data.
|
||||
helpsetUrl = doc/en/doc.hs
|
||||
helpsetUrl = doc/doc_en.hs
|
||||
#
|
||||
# Popups.java
|
||||
#
|
||||
|
|
|
@ -77,7 +77,7 @@ helpAboutItem= \u041e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435...
|
|||
helpNotFoundError= \u0414\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u0440\u0430\u0432\u043a\u0438 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b.
|
||||
helpUnavailableError= \u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u0440\u0430\u0432\u043a\u0438.
|
||||
helpDisplayError= \u041d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u043f\u0440\u0430\u0432\u043a\u0438.
|
||||
helpsetUrl= doc/ru/doc.hs
|
||||
helpsetUrl= doc/doc_ru.hs
|
||||
#
|
||||
# Popups.java
|
||||
#
|
||||
|
|
Loading…
Reference in New Issue