and
tags from their escape sequence counterparts
html = html.replace('<code>', '')
html = html.replace('</code>', '
')
# Remove Arrows from footnotes and margin notes
html = html.replace('[→', '[')
html = html.replace('→]', ']')
# Strip off cut material using the flag '#! CUT MATERIAL'
CUT_FLAG = '#! CUT MATERIAL'
pr3 ("\nCUT_FLAG")
pr3 ("Anything placed after the CUT_FLAG in your document will not be uploaded.")
pr3 ("This is helpful for keeping notes that you might put back in a later draft.")
if(ELYXER_ENGINE):
# ELYXER may put a tag in if you change the size
exp = re.compile('
Edit Links |
Tools /
LyxBlogger
<< ELyXer | Page list | >>
LyxBlogger allows LyX to post beautifully formatted code directly to your WordPress blog. LyxBlogger 0.32This document is a snapshot of the LyxBlogger wiki page, http://wiki.lyx.org/Tools/LyxBlogger, taken on March 27, 2010, coinciding with the release date of LyxBlogger 0.32. PremiseLyX really is a new way of thinking about documents. There is a bit of a learning curve about it, but once you get the formatting set up the way you want it, each successive chapter in your book sets up exactly the same-- automatically. It also prevents you from doing things that don't normally make sense, like putting two spaces between a word, or a space at the beginning of a paragraph. It won't even let you accidentally (or on purpose) put two blank lines between paragraphs. Content is content and layout is layout - and LyX does a good job keeping them separate. So many of us have become LyX addicts for these and other reasons. But when one wants to publish to the web, as in creating an online blog, there comes a dilemma of the having your cake and eating it too variety. Of course LyX users still want to compose everything they do in LyX. But blogging engines, such as WordPress, don't speak LyX, and they don't understand PDF either. They hunger for none other than xhtml. Ah, but how to get your beautiful looking, carefully arranged document from LyX to WordPress, while retaining your document's organization and allowing you to still manage your own CSS style file to tweak the formatting? LyX die hards have done it the hard way before. Like composing a document in LyX, then copying the screen into the blog engine composition window, and re-adding any formatting that was lost for titles, headings, emphasis, lists, and so on. Well those days are over. Now you can talk directly from LyX to your favorite blogging engine. That is, as long as your favorite blogging engine is WordPress. SolutionLyxBlogger allows you to post to your WordPress blog right from LyX. LyxBlogger 0.32 comes with the following features:
DownloadLyxBlogger is available as a free download from http://code.google.com/p/lyxblogger. InstallationFirst, make sure you have Python installed on your machine. (Developed on Python 2.6.4) Then install LyxBlogger by downloading the latest version from here. Install it by running $ tar -xvf LyxBlogger_x.xx.tar.gz
$ cd LyxBlogger_x.xx/
$ sudo cp lyxblogger /usr/bin/.
You must also install the wordpresslib.py library (included in LyxBlogger_x.xx.tar.gz file). To install the wordpresslib.py library, enter the command $ python setup.py install
An xhtml converter is also required. Select and install an appropriate xhtml converter for your version of LyX. Supported xhtml converters for LyX 1.6.xSupported xhtml converters for LyX 2.0
RunningTo invoke LyxBlogger, first generate (x)html by previewing LyXHTML from LyX 2.0, or by either previewing or manually invoking eLyXer. Then cd to the directory where the (x)html files and images reside The location is shown in your browser window when you preview. Invoke LyxBlogger as $ lyxblogger input_file.(x)html
Auto Log InLyxBlogger comes out of the box ready to upload to a test site (blogtest.letseatalready.com) where you can test its posting capability. LyxBlogger will ask you whether to post to the test site or not. Once you can post to the test site, just run LyxBlogger again, this time telling it to use a different site instead. It will prompt you for your domain name, user name, and password. To facilitate automatic login to your own site, just change the following lines
in the AUTO_URL = 'http://blogtest.letseatalready.com/xmlrpc.php'
AUTO_USER = 'test'
AUTO_PASSWORD = 'test'
AUTO_LOGIN = True
Simply put your own domain in place of blogtest.letseatalready.com, leaving the LyX IntegrationYou may choose to use LyxBlogger solely from the command line. But it is often more conventient to set up LyxBlogger as a converter inside LyX so that you can just click a couple buttons when you are ready to upload your content. Then LyX automatically generates the xhtml for you using your selected xhtml converter, copies the xhtml file and any associated image files to a temporary directory, and uses those files when invoking LyxBlogger. Converter Setup for eLyXer HTML FormatTo set up LyX to use the eLyXer xhtml format when using LyxBlogger, first install eLyXer and set it up as LyX --> HTML converter in LyX. Use the standard options in your converter line: Converter: elyxer.py --directory $$r $$i $$o
For help installing eLyXer, see http://www.nongnu.org/elyxer/. Next you need to find out what your eLyXer output format is called in LyX. I renamed mine eLyXer_HTML to avoid confusion. Now go to Tools-> Preferences-> File Handling-> File Formats. Create a new file format. Give it a descriptive name like LyxBlogger Publish eLyXer_HTML to WordPress
Make sure you check Document Format. Give it a unique Short name and Extension. Then click on Converters and define a new converter as follows: From_Format: eLyXer_HTML
To_Format: LyxBlogger Publish eLyXer_HTML to WordPress
Converter: lyxblogger $$i
Now you can invoke this converter from within LyX by clicking File-> Export-> LyxBlogger Publish eLyXer_HTML to WordPress. Converter Setup for Lyx 2.0 (internal) LyXHTML FormatLyX 2.0 comes with LyXHTML support already built in. To set up LyX to use the internal LyXHTML format when using LyxBlogger, open LyX 2.0 and go to Tools-> Preferences-> File Handling-> File Formats. Create a new file format. Give it a descriptive name like LyxBlogger Publish LyXHTML to WordPress
Make sure you check Document Format. Give it a unique Short name and Extension. Then click on Converters and define a new converter as follows: From_Format: LyXHTML
To_Format: LyxBlogger Publish LyXHTML to WordPress
Converter: lyxblogger $$i
Now you can invoke this converter from within LyX 2.0 by clicking File-> Export-> LyxBlogger Publish LyXHTML to WordPress. History
ContributorsCategories |