diff --git a/doc/build_dist_doc.sh b/doc/build_dist_doc.sh index 89a859f0..1ef6ecff 100755 --- a/doc/build_dist_doc.sh +++ b/doc/build_dist_doc.sh @@ -39,6 +39,7 @@ then for lang in en pt do rm -f $lang/arch_platform_*.html + rm -f $lang/refman_gen_*.html done rm -f index_*.html wb/wb_usr.lua ssSearch*.html wb_bar_*.html rm -f wb_search*.txt wb_title*.html wb_tree*.html diff --git a/doc/builddoc.lua b/doc/builddoc.lua index e99ae10b..daeb11ae 100644 --- a/doc/builddoc.lua +++ b/doc/builddoc.lua @@ -7,7 +7,7 @@ local doc_sections = { "arch_platform", "refman_gen" } local components = { arch_platform = { "ll", "pio", "spi", "uart", "timers", "pwm", "cpu", "eth" }, - refman_gen = { "cpu" } + refman_gen = { "bit", "pd", "cpu", "pack" } } -- List here all languages for the documentation (make sure to keep English ("en") the first one) @@ -40,6 +40,8 @@ end - the string "eLua" becomes eLua - strings between two tildas (~~) get special code-like formatting - newlines are changed to ' ' if 'keepnl' isn't true +- '&' is translated to its corresponding HTML code. +- '<<' and '>>" are also translated to the corresponding HTML codes (note the repetition). --]] local function format_string( str, keepnl ) -- replace double "special chars" with "temps" for later use @@ -49,23 +51,36 @@ local function format_string( str, keepnl ) str = str:gsub( "%^%^", "\004" ) str = str:gsub( "~~", "\005" ) + -- Translate 'special' HTML chars to their equivalents + local tr_table = + { + [ "%&" ] = "&", + } + for char, rep in pairs( tr_table ) do + str = str:gsub( char, rep ) + end + + -- some double chars are replaced directly with their HTML codes + str = str:gsub( "<<", "<" ) + str = str:gsub( ">>", ">" ) + -- replace eLua with eLua str = str:gsub( "eLua", "eLua" ) -- $string$ becomes string> - str = str:gsub( "%$([^%s][^%$]+)%$", "%1" ) + str = str:gsub( "%$([^%s%$][^%$]*)%$", "%1" ) -- %string% becomes string - str = str:gsub( "%%([^%s][^%%]+)%%", "%1" ) + str = str:gsub( "%%([^%s%%][^%%]*)%%", "%1" ) -- @ref@text@ becomes text - str = str:gsub( "@([^%s][^@]+)@([^%s][^@]+)@", '%2' ) + str = str:gsub( "@([^%s@][^@]*)@([^%s@][^@]*)@", '%2' ) -- ^ref^text^ becomes text - str = str:gsub( "%^([^%s][^%^]+)%^([^%s][^%^]+)%^", '%2' ) + str = str:gsub( "%^([^%s%^][^%^]*)%^([^%s%^][^%^]*)%^", '%2' ) -- strings between two tildas (~~) get special code-like formatting - str = str:gsub( "~([^%s][^~]+)~", function( x ) + str = str:gsub( "~([^%s~][^~]*)~", function( x ) x = x:gsub( "\n", "
" ) x = x:gsub( "%s%s+", function( x ) return ( " " ):rep( #x ) end ) return "

" .. x .. "

" diff --git a/doc/en/refman_gen.html b/doc/en/refman_gen.html new file mode 100644 index 00000000..5e45e7af --- /dev/null +++ b/doc/en/refman_gen.html @@ -0,0 +1,11 @@ + + + +eLua reference manual - generic modules + + + +

Reference manual - generic modules

+

This part of the reference manual presents the generic modules in eLua (see here for more information about generic +modules).

+ diff --git a/doc/en/tut_bootstick.html b/doc/en/tut_bootstick.html index a2bb14e0..0bf6db4a 100644 --- a/doc/en/tut_bootstick.html +++ b/doc/en/tut_bootstick.html @@ -36,7 +36,7 @@ Your call.

Prerequisites

-

To have your own bootable eLua USB stick you'll need: +

To have your own bootable eLua USB stick you'll need: