<commit_before>NB.*TeXfrWpxml s-- LaTeX source from WordPress export XML.
NB.
NB. verbatim:
NB.
NB. http://bakerjd99.wordpress.com/2012/02/11/wordpress-to-latex-with-pandoc-and-j-prerequisites-part-1/
NB.
NB. interface word(s): 
NB. ------------------------------------------------------------------------------
NB. BlogHashes       - update blog hashes
NB. FixBaddown       - attempt to convert *.baddown files to *.markddown
NB. LatexFrWordpress - experimental conversion of Wordpress XML to LaTeX
NB. MainMarkdown     - assembles all *.markdown files in a master file
NB. MarkdownFrLatex  - converts edited LaTeX post files to image free markdown
NB.                                                         
NB. author:  <NAME>
NB. created: 2012feb10
NB. ------------------------------------------------------------------------------ 
NB. 12feb24 (MarkdownFrLatex) added
NB. 12feb27 (FixBaddown, MainMarkdown) added
NB. 12feb29 (blogimgs) added
NB. 12jun28 (sortonpublishdate) added - publish order not always post id
NB. 12oct08 changed (texFrhtml) to process pandoc highlighted source
NB. 13dec20 save copy in GitHub (jacks) repository
NB. 15may06 (BlogHashes) added
NB. 17may13 (LATEXFIGURETEMPLATES) added

require 'task'
coclass 'TeXfrWpxml' 

NB.*dependents
NB. declared global here to avoid confusing 
NB. following HTML and LaTeX names with J names
NB. (*)=: EPUBAMBLE EPUBFILE EPUBFRWPDIR HTMLREPS LATEXFIGURETEMPLATES LSTLISTINGHDR LSTLISTINGEND 
NB. (*)=: MARKDOWNFILE TEXPREAMBLE TEXFRWPDIR TEXINCLUSIONS TEXSECTIONTITLE TEXWRAPFIGURE TEXROOTFILE

NB. profile & require words (*)=. IFIOS UNAME

NB. dll/so is machine/os specific - assumes jqt 8.02 or later is installed
OPENSSL=: ;(IFIOS + (;:'Win Linux Android Darwin') i. <UNAME) { 'libeay32.dll '; (2 $ <'libssl.so '); (2 $ <'libssl.dylib ')

NB. call dll
cd=: 15!:0
sslsha1=: (OPENSSL , ' SHA1 > + x *c x *c')&cd
NB.*enddependents

EPUBAMBLE=: 0 : 0
% Analyze the Data not the Drivel
% <NAME>

)

NB. name of generated EPUB file
EPUBFILE=:'bm.epub'
   
NB. root EPUB from LaTeX directory
EPUBFRWPDIR=:'c:/pd/blog/wp2epub/'

NB. XML CDATA encoding and replacement for special characters
NB. stored in this form to hide the characters from web browsers
HTMLREPS=: 35 38 108 116 59 35 60 35 38 103 116 59 35 62 35 38 113 117 111 116 59 35 34 35 38 97 109 112 59 35 38
HTMLREPS=: HTMLREPS{a.

NB. default lstlisting source block header
LSTLISTINGHDR=: 0 : 0
\begin{lstlisting}[frame=single,framerule=0pt,label=lst:~~~LSTLABEL~~~,
caption={source caption}]<commit_msg>use J 8.06 sha hash functions instead of external binaries<commit_after>NB.*TeXfrWpxml s-- LaTeX source from WordPress export XML.
NB.
NB. verbatim:
NB.
NB. http://bakerjd99.wordpress.com/2012/02/11/wordpress-to-latex-with-pandoc-and-j-prerequisites-part-1/
NB.
NB. interface word(s): 
NB. ------------------------------------------------------------------------------
NB. BlogHashes       - update blog hashes
NB. FixBaddown       - attempt to convert *.baddown files to *.markddown
NB. LatexFrWordpress - experimental conversion of Wordpress XML to LaTeX
NB. MainMarkdown     - assembles all *.markdown files in a master file
NB. MarkdownFrLatex  - converts edited LaTeX post files to image free markdown
NB.                                                         
NB. author:  <NAME>
NB. created: 2012feb10
NB. ------------------------------------------------------------------------------ 
NB. 12feb24 (MarkdownFrLatex) added
NB. 12feb27 (FixBaddown, MainMarkdown) added
NB. 12feb29 (blogimgs) added
NB. 12jun28 (sortonpublishdate) added - publish order not always post id
NB. 12oct08 changed (texFrhtml) to process pandoc highlighted source
NB. 13dec20 save copy in GitHub (jacks) repository
NB. 15may06 (BlogHashes) added
NB. 17may13 (LATEXFIGURETEMPLATES) added
NB. 17sep29 use J 8.06 sha hash functions - removes need for external dll

require 'task'
coclass 'TeXfrWpxml' 

NB.*dependents
NB. declared global here to avoid confusing 
NB. following HTML and LaTeX names with J names
NB. (*)=: EPUBAMBLE EPUBFILE EPUBFRWPDIR HTMLREPS LATEXFIGURETEMPLATES LSTLISTINGHDR LSTLISTINGEND 
NB. (*)=: MARKDOWNFILE TEXPREAMBLE TEXFRWPDIR TEXINCLUSIONS TEXSECTIONTITLE TEXWRAPFIGURE TEXROOTFILE

NB. profile & require words (*)=. IFIOS UNAME

NB. dll/so is machine/os specific - assumes jqt 8.02 or later is installed
NB. OPENSSL=: ;(IFIOS + (;:'Win Linux Android Darwin') i. <UNAME) { 'libeay32.dll '; (2 $ <'libssl.so '); (2 $ <'libssl.dylib ')

NB. call dll
NB. cd=: 15!:0
NB. sslsha1=: (OPENSSL , ' SHA1 > + x *c x *c')&cd
NB.*enddependents

EPUBAMBLE=: 0 : 0
% Analyze the Data not the Drivel
% <NAME>

)

NB. name of generated EPUB file
EPUBFILE=:'bm.epub'
   
NB. root EPUB from LaTeX directory
EPUBFRWPDIR=:'c:/pd/blog/wp2epub/'

NB. XML CDATA encoding and replacement for special characters
NB. stored in this form to hide the characters from web browsers
HTMLREPS=: 35 38 108 116 59 35 60 35 38 103 116 59 35 62 35 38 113 117 111 116 59 35 34 35 38 97 109 112 59 35 38
HTMLREPS=: HTMLREPS{a.

NB. default lstlisting source block header
LSTLISTINGHDR=: 0 : 0
\begin{lstlisting}[frame=single,framerule=0pt,label=lst:~~~LSTLABEL~~~,
caption={source caption}]
{'fraction_non_alphanumeric': 0.14995187680461983, 'fraction_numerical': 0.05543792107795958, 'mean_word_length': 2.871833084947839, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '326791', 'n_tokens_mistral': 2100, 'n_tokens_neox': 1693, 'n_words': 606}