diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index e788149..50b2a0b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -56,6 +56,7 @@ - refactor glossary tool - add HTML version of the Glossary +- add more concise text copies of the Glossary - add man pages ## Examples @@ -63,6 +64,7 @@ - add Buffer.forth - add CaptureOutput.forth - add DisplayNames.forth +- add HTML.forth - add KeyValueStore.forth - add Marker.forth - add net_fetch.forth diff --git a/example/HTML.forth b/example/HTML.forth new file mode 100644 index 0000000..f72753e --- /dev/null +++ b/example/HTML.forth @@ -0,0 +1,24 @@ +# HTML Generation + +This is a little experiment in combinator-driven HTML generation. + +~~~ +:a:href (ss-) ' s:put s:put ' s:put ; +:p (q-) '

s:put call '

s:put nl ; +:strong (q-) ' s:put call ' s:put nl ; +:em (q-) ' s:put call ' s:put nl ; +:h1 (s-) '

s:put s:put '

s:put nl ; +:div (q-) '
s:put call '
s:put nl ; +:body (q-) ' s:put call ' s:put nl ; +:prefix:" s:keep &s:put compile:call ; immediate +~~~ + +Test case: + +``` +[ 'Hello h1 + [ "This_is_a_test_of_HTML_generation._Please_ + 'follow_the_link 'page2.html a:href ". ] p + [ "This_is_a_second_paragraph ] p +] body +``` diff --git a/glossary.forth b/glossary.forth index 3f6e369..1050653 100755 --- a/glossary.forth +++ b/glossary.forth @@ -584,8 +584,8 @@ to use. '__interface '-------------------------------- 'Export_Formats: - '__glossary - '__tsv + '__glossary____concise + '__tsv_________concise-stack '-------------------------------- } [ s:put nl ] set:for-each ; ~~~