Closed 01micko closed 2 years ago
I think the last time I was working on the wiki was back in 2018.
See
https://github.com/puppylinux-woof-CE/gtkdialog/issues/86#issuecomment-575219693
Thanks. I think I've figured out how to convert wiki markdown to html and keep the formatting, and I'll post about that later.
@woodenshoe-wi and @dimkr
Ok, this what I did
docs/reference/
Here's the script with pandoc
in the comments
#!/bin/sh
## script to convert gfm markdown to html _specifically_ for gtkdialog
## gpl-v2
## REQUIRES pandoc + sed, grep etc
## SEE https://github.com/jgm/pandoc (used prebuilt static bin)
## invoke with something like this
# for i in *md;do ./md2html.sh ${i%\.*};done
## then copy the results to the docs/reference dir
! type pandoc >/dev/null 2>&1 && echo 'Pandoc not available' && exit 1
X=${1}.md
# create the header
cat > ${1}.html <<HEAD
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>gtkdialog: $1 widget reference</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" >
<style type="text/css">
body {
font-size: 14px;
font-family: arial, verdana, sans-serif;
background-color: #e0e0e8;
}
h1 {
font-size: 24px;
}
h2 {
font-size: 18px;
}
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:active {
text-decoration: none;
}
a:hover {
color: #8080ff;
text-decoration: underline;
}
hr {
color: #a8a8b0;
background-color: #a8a8b0;
height: 1px;
border: 0;
}
pre {
background-color: #e8e8f0;
/*width: 500px;*/
border: 1px dotted #b8b8c0;
padding: 10px;
}
tt {
background-color: #e8e8f0
}
sup {
font-size: 10px;
}
table.wiki {
/*border-color: #ff0000;*/
border-color: #c8c8d0;
border-width: 0px 0px 2px 2px;
border-style: solid;
border-collapse: collapse;
border-spacing: 0px;
}
td.wiki, th.wiki {
/*border-color: #00ff00;*/
border-color: #c8c8d0;
border-width: 2px 2px 0px 0px;
border-style: solid;
}
th.wiki {
background-color: #e8e8f0;
}
.footer {
font-size: 14px;
}
</style>
</head>
<body bgcolor="#e0e0e8">
<!--<table width="978" align="center" bgcolor="#b8b8c0" cellpadding="0px" cellspacing="1px">-->
<table bgcolor="#b8b8c0" cellpadding="0px" cellspacing="1px">
<tr>
<td>
<table bgcolor="#ffffff" cellpadding="0px" cellspacing="10px">
<tr>
<td>
HEAD
# get the body
pandoc $X -f markdown -t html | sed -e '/<thead>/d' \
-e '/<\/thead>/d' \
-e '/<col/d' \
-e '/<\/col/d' \
-e 's/<code>/<tt>/g' \
-e 's/<\/code>/<\/tt>/g' \
-e 's/<pre><tt>/<pre><code>/' \
-e 's/<\/tt><\/pre>/<\/code><\/pre>/' \
-e 's/<table/<table class="wiki" border="1" cellpadding="5px"/g' \
-e 's/<td/<td class="wiki"/g' \
-e 's/<th/<th class="wiki"/g' \
-e 's/<tr class=\".*\">/<tr>/g' \
-e 's/<hr \/>/<hr>/g' \
-e 's/ id=\"\([a-z]*[a-z]\)-widget\"//g' \
-e 's/ id=\"definition\"//g' \
-e 's/ style=\".*\"//g' \
-e 's/\.md/\.html/g' \
>> ${1}.html
# footer
cat >> ${1}.html <<FOOT
<p>
<a href="button.html">button</a>,
<a href="checkbox.html">checkbox</a>,
<a href="colorbutton.html">colorbutton</a>,
<a href="comboboxentry.html">comboboxentry</a>,
<a href="comboboxtext.html">comboboxtext</a>,
<a href="combobox.html">combobox</a>,
<a href="edit.html">edit</a>,
<a href="entry.html">entry</a>,
<a href="eventbox.html">eventbox</a>,
<a href="expander.html">expander</a>,
<a href="fontbutton.html">fontbutton</a>,
<a href="frame.html">frame</a>,
<a href="hbox.html">hbox</a>,
<a href="hscale.html">hscale</a>,
<a href="hseparator.html">hseparator</a>,
<a href="list.html">list</a>,
<a href="menubar.html">menubar</a>,
<a href="menuitemseparator.html">menuitemseparator</a>,
<a href="menuitem.html">menuitem</a>,
<a href="menu.html">menu</a>,
<a href="notebook.html">notebook</a>,
<a href="pixmap.html">pixmap</a>,
<a href="progressbar.html">progressbar</a>,
<a href="radiobutton.html">radiobutton</a>,
<a href="separator.html">separator</a>,
<a href="spinbutton.html">spinbutton</a>,
<a href="statusbar.html">statusbar</a>,
<a href="table.html">table</a>,
<a href="terminal.html">terminal</a>,
<a href="text.html">text</a>,
<a href="timer.html">timer</a>,
<a href="togglebutton.html">togglebutton</a>,
<a href="tree.html">tree</a>,
<a href="vbox.html">vbox</a>,
<a href="vscale.html">vscale</a>,
<a href="vseparator.html">vseparator</a>,
<a href="window.html">window</a>,
</p>
<p> </p>
<p align="center"><strong>For GTK+ 3 reference see <a href="https://docs.gtk.org/gtk3/">the Gtk-3.0 docs</a> page</strong></p>
</td>
</tr>
<tr>
<td>
<table width="100%" cellpadding="0px" cellspacing="0px">
<tr>
<td class="footer" width="33%" align="center">2013-04-01 <a href="mailto:thunorsif@hotmail.com">Thunor</a></td>
<td class="footer" width="33%" align="center"><a href="http://code.google.com/p/gtkdialog/">Project Page</a></td>
<td class="footer" width="33%" align="center"><a href="http://www.murga-linux.com/puppy/viewtopic.php?t=69188">Development Thread</a></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
FOOT
Keeping this open because gtk-3 needs reference links.
I think we're ok now :smile:
The doc links are broken (re #113) but the wiki and docs need updating anyway with the addition of gtk3 and
gtk_layer_shell
support.I'll attempt to fix the wiki first then see if I can fix the
docs/reference/export
script for github wiki.@woodenshoe-wi to save effort duplication, have you attempted this before?