SlideShare uma empresa Scribd logo
1 de 4
Baixar para ler offline
Easy Blogging With Emacs
Time after time I write technical blogs and articles that describe and summarise my
experiences. Nowadays all the blogging sites and tools offer WYSIWYG editors. And it
makes blogging so easy, right? Not for me! I always find WYSIWYG editing tedious and
frustrating.
Table Of Contents
• Why WYSIWYG sucks
• Org-mode of Emacs
• Installing Emacs
• Using org-mode for writing documents
• Publishing the document
• Converting the document to PDF
Why WYSIWYG Sucks
One reason is that you have to make manually every single change (no styles like CSS for
example), which makes the process tedious, error prone and inconsistent. If you decide
later to change some styles, you have to go all over the document and modify all
occurrences one by one… Oh man, better don't touch it at all!
But the worst thing about WYSIWYG is that actually its last name is WYGIANWYW (What
You Get Is Almost Never What You Want). I have struggled many times with the editor
because it would never understand correctly what I wanted and would display a totally
broken formatting (long live undo that comes quickly to the rescue).
So, I'd rather write plain text HTML than use WYSIWYG editing, unless the structure and
formatting of the document is very simple. Maybe not everybody finds WYSIWYG so
difficult and annoying, but the technical blogs (articles, documents, etc.) that I write are a
bit long and with complex structure, and WYSIWYG would never be suitable for me. I have
also tried different wiki systems, which in a sense are better than WYSIWYG, but still they
are a bit simple and do not support all the features that I need.
Org­Mode Of Emacs
After trying different tools and systems, I decided that the orgmode of Emacs is the best
for my needs. Quoting from its webpage:
"Org mode is for keeping notes, maintaining TODO lists, planning projects, and
authoring documents with a fast and effective plain-text system."
So, among other things, org-mode can be used for authoring documents, that is writing
blogs, articles etc.
It has a wiki-like syntax that is lightweight but also complex (not-simple). Combined with the
editing power of Emacs it becomes a powerful tool for writing blogs, articles and other
docs. Then, it can be converted automatically to other formats, like HTML, LaTeX, PDF, etc.
I will try to describe how I use it for my needs (writing blogs, articles, etc.)
Installing Emacs
On Ubuntu it can be installed like this: sudo apt-get install emacs On other Linux systems
it should be very easy too. If you are using Windows, then look at the instructions on this
page.
The latest versions of Emacs include org-mode by default, so there is no need to do
anything special for installing it. Just use the extension .org for the file and the org editing
mode will be enabled automatically.
Using Org­Mode For Writing Documents
Emacs is an advanced editing tool and org-mode has lots of features, however not all of
them are needed. For what we want to do (writing technical blogs and docs), we need some
very basic and simple things.
I will list the ones that I use most frequently:
• Paragraphs are marked by empty lines:
Paragraph1
Paragraph1 continued
Paragraph2
Paragraph2 continued
• Headings are marked by stars at the beginning of a line:
* Heading1
** Heading2
*** Heading3
** Heading2
* Heading1
** Heading2
• Ordered and unordered lists:
+ item-1
1. item-1.1
2. item-1.2
3. item-1.3
+ item-2
- item-2.1
- item-2.2
- item-2.3
+ item-3
• item-1
1. item-1.1
2. item-1.2
3. item-1.3
• item-2
1. item-2.1
2. item-2.2
3. item-2.3
• item-3
• Inline markup:
*bold*, /italic/, _underlined_, =code= and ~verbatim~
bold, italic, underlined, code and verbatim
• Hyperlink:
[[http://info.btranslator.org][B-Translator]]
B-Translator
• Preformatted:
#+BEGIN_EXAMPLE
Some example from a text file.
# +END_EXAMPLE
Some example from a text file.
It is so simple, intuitive and familiar, that you don't even need a tutorial and can start using
it right away.
You can find more about the markup that can be used, on the documentation of org-mode
(or try info org on the terminal).
As an example, you can see the org code of this document itself on gist: easy-blogging-with-
emacs.org
Publishing The Document
In order to publish the document, I do these steps:
1. First, convert it to HTML (with the emacs command: C-c C-e h).
2. Then open the generated HTML file in a browser.
3. And then copy/paste the content of the article from the browser to the editor of the
blog site.
I don't know why, but a copy/paste like this usually works very well. I use Blogger for my
blogs, but I think that it should work on other blog sites and WYSIWYG editors as well.
After the copy/paste, I still have to do some minor manual corrections, but this is much
easier than writing the whole thing on the WYSIWYG editor.
Pay attention to these lines that are at the beginning of the org file:
#+OPTIONS: num:nil toc:t ^:nil f:nil TeX:nil LaTeX:nil
#+STYLE: <link href="css/org.css" rel="stylesheet" type="text/css"/>
They control the look of the generated HTML file. The first one defines some
settings/options, like: don't number headers, generate a TOC, turn off TeX syntax for
subscripts, etc. More details and other options you can find on the documentation for
export settings.
The second line tells it which CSS file to use, so that the generated HTML looks nice and
beautiful. For a quick start, just download and use my org.css file, and later you can
customise it for yourself. For example, it defines the style of preformatted text like this:
pre {
padding: 10px;
border: 1pt solid #AEBDCC;
border-radius: 5px;
background-color: #000000;
color: #eeeeee;
font-family: Ubuntu Mono, monospace, courier;
}
Converting The Document To PDF
Org-mode can convert directly to PDF. However there is no way (as far as I know) to modify
how the generated PDF file looks like. It always has the same standard look of an old
scientific paper (I guess that the conversion to PDF is done by converting first to LaTeX).
I prefer to take another approach for generating PDF docs:
1. First I generate the HTML file (where I can control how it looks by customising the
CSS file).
2. Then I copy/paste from the browser to LibreOffice (yes, this copy/paste works well
too, preserving all the formatting and styles from HTML).
3. Finally save it as PDF. LibreOffice has a built-in PDF converter.
However, before the third step I do again some minor manual modifications. I also define
styles for headings, preformatted text, text body, etc.
One of the things that I change in LibreOffice/PDF document is the style of the
preformatted text. In the HTML version it is white font on a black background, and this is
good because it looks like a terminal. However PDF documents sometimes can be printed
and that style doesn't look nice on paper (and also it would consume lots of ink), so I change
it to black font on white background.
To apply the new style on a preformatted text, I select it, then from the list of styles (on
top-left) select "Clear formatting", then select the style "Preformatted Text". I have to do
this for all the preformatted texts. I do the same thing for headings as well.
In order to not re-define the styles for each document, I open an old document, replace its
content with the new content, and then save it with a new name. This will ensure that the
styles of the new document are the same as the styles of the old one. Maybe LibreOffice
has some other means for defining the styles and using them on each document, but I am
not so familiar with LibreOffice and this trick works anyway.
If you want to use my styles, you can download the .odt document from here and use it as a
template for your own docs.
Author: Dashamir Hoxha <dashohoxha@gmail.com>
Date: 12 July 2013
HTML generated by org-mode 6.33x in emacs 23

Mais conteúdo relacionado

Mais procurados (20)

Html
HtmlHtml
Html
 
Lesson 1: Introduction to HTML
Lesson 1: Introduction to HTMLLesson 1: Introduction to HTML
Lesson 1: Introduction to HTML
 
HTML TAGS
HTML TAGSHTML TAGS
HTML TAGS
 
Html
HtmlHtml
Html
 
Basics of HTML 5 for Beginners
Basics of HTML 5 for Beginners Basics of HTML 5 for Beginners
Basics of HTML 5 for Beginners
 
HTML Introduction, HTML History, HTML Uses, HTML benifits
HTML Introduction, HTML History, HTML Uses, HTML benifitsHTML Introduction, HTML History, HTML Uses, HTML benifits
HTML Introduction, HTML History, HTML Uses, HTML benifits
 
Week 5 Lecture
Week 5 LectureWeek 5 Lecture
Week 5 Lecture
 
Introduction to html
Introduction to htmlIntroduction to html
Introduction to html
 
Html basics
Html basicsHtml basics
Html basics
 
Web design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introductionWeb design - HTML (Hypertext Markup Language) introduction
Web design - HTML (Hypertext Markup Language) introduction
 
Week 6 Lecture
Week 6 LectureWeek 6 Lecture
Week 6 Lecture
 
Html tutorials
Html tutorialsHtml tutorials
Html tutorials
 
Notepad
NotepadNotepad
Notepad
 
Html notes with Examples
Html notes with ExamplesHtml notes with Examples
Html notes with Examples
 
Basic html structure
Basic html structureBasic html structure
Basic html structure
 
Html introduction by ikram niaz
Html introduction by ikram niazHtml introduction by ikram niaz
Html introduction by ikram niaz
 
Lesson4.9 a u4l2 html
Lesson4.9 a u4l2 htmlLesson4.9 a u4l2 html
Lesson4.9 a u4l2 html
 
Notepad ++
Notepad ++Notepad ++
Notepad ++
 
Web designing using html
Web designing using htmlWeb designing using html
Web designing using html
 
Css presentation lecture 1
Css presentation lecture 1Css presentation lecture 1
Css presentation lecture 1
 

Destaque

IT Strategy of Albanian Customs
IT Strategy of Albanian CustomsIT Strategy of Albanian Customs
IT Strategy of Albanian CustomsDashamir Hoxha
 
European union common border crossings management project
European union common border crossings management projectEuropean union common border crossings management project
European union common border crossings management projectKatrin Sulg
 
Easy Blogging With Emacs -- Cheatsheet
Easy Blogging With Emacs -- CheatsheetEasy Blogging With Emacs -- Cheatsheet
Easy Blogging With Emacs -- CheatsheetDashamir Hoxha
 
European commission report 2013
European commission report 2013European commission report 2013
European commission report 2013Katrin Sulg
 
Easy Blogging With Emacs
Easy Blogging With EmacsEasy Blogging With Emacs
Easy Blogging With EmacsDashamir Hoxha
 
Autobiography of Benjamin Franklin
Autobiography of Benjamin FranklinAutobiography of Benjamin Franklin
Autobiography of Benjamin FranklinDashamir Hoxha
 
1. e freight-fundamentals
1. e freight-fundamentals1. e freight-fundamentals
1. e freight-fundamentalsssshhhsss
 
Customs and Border Management
Customs and Border ManagementCustoms and Border Management
Customs and Border ManagementAlain Clo
 

Destaque (8)

IT Strategy of Albanian Customs
IT Strategy of Albanian CustomsIT Strategy of Albanian Customs
IT Strategy of Albanian Customs
 
European union common border crossings management project
European union common border crossings management projectEuropean union common border crossings management project
European union common border crossings management project
 
Easy Blogging With Emacs -- Cheatsheet
Easy Blogging With Emacs -- CheatsheetEasy Blogging With Emacs -- Cheatsheet
Easy Blogging With Emacs -- Cheatsheet
 
European commission report 2013
European commission report 2013European commission report 2013
European commission report 2013
 
Easy Blogging With Emacs
Easy Blogging With EmacsEasy Blogging With Emacs
Easy Blogging With Emacs
 
Autobiography of Benjamin Franklin
Autobiography of Benjamin FranklinAutobiography of Benjamin Franklin
Autobiography of Benjamin Franklin
 
1. e freight-fundamentals
1. e freight-fundamentals1. e freight-fundamentals
1. e freight-fundamentals
 
Customs and Border Management
Customs and Border ManagementCustoms and Border Management
Customs and Border Management
 

Semelhante a Easy Blogging With Emacs

Semelhante a Easy Blogging With Emacs (20)

Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...Web Development From the Ground Up, a Series for Novice ...
Web Development From the Ground Up, a Series for Novice ...
 
Slides 2 - HTML
Slides 2 - HTMLSlides 2 - HTML
Slides 2 - HTML
 
Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)Markup For Dummies (Russ Ward)
Markup For Dummies (Russ Ward)
 
HTML & CSS.ppt
HTML & CSS.pptHTML & CSS.ppt
HTML & CSS.ppt
 
EPUB - a workshop for beginners
EPUB - a workshop for beginnersEPUB - a workshop for beginners
EPUB - a workshop for beginners
 
Joomla tempates talk
Joomla tempates talkJoomla tempates talk
Joomla tempates talk
 
Oreilly
OreillyOreilly
Oreilly
 
GDI Seattle Intro to HTML and CSS - Class 1
GDI Seattle Intro to HTML and CSS - Class 1GDI Seattle Intro to HTML and CSS - Class 1
GDI Seattle Intro to HTML and CSS - Class 1
 
Html tutorials
Html tutorialsHtml tutorials
Html tutorials
 
Class1slides
Class1slidesClass1slides
Class1slides
 
(Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS (Fast) Introduction to HTML & CSS
(Fast) Introduction to HTML & CSS
 
Unit 5 application layer
Unit 5 application layerUnit 5 application layer
Unit 5 application layer
 
HTML-INTRO.pptx
HTML-INTRO.pptxHTML-INTRO.pptx
HTML-INTRO.pptx
 
Html
HtmlHtml
Html
 
Html
HtmlHtml
Html
 
Week 2-intro-html
Week 2-intro-htmlWeek 2-intro-html
Week 2-intro-html
 
2a web technology html basics 1
2a web technology html basics 12a web technology html basics 1
2a web technology html basics 1
 
Mdst 3559-02-01-html
Mdst 3559-02-01-htmlMdst 3559-02-01-html
Mdst 3559-02-01-html
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
HTML Bootcamp
HTML BootcampHTML Bootcamp
HTML Bootcamp
 

Mais de Dashamir Hoxha

Development Setup of B-Translator
Development Setup of B-TranslatorDevelopment Setup of B-Translator
Development Setup of B-TranslatorDashamir Hoxha
 
Using Drupal Features in B-Translator
Using Drupal Features in B-TranslatorUsing Drupal Features in B-Translator
Using Drupal Features in B-TranslatorDashamir Hoxha
 
Strategjia për IT-në e Doganës Shqiptare
Strategjia për IT-në e Doganës ShqiptareStrategjia për IT-në e Doganës Shqiptare
Strategjia për IT-në e Doganës ShqiptareDashamir Hoxha
 
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.1x Software as Service
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.1x Software as ServiceCertificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.1x Software as Service
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.1x Software as ServiceDashamir Hoxha
 
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS188.1x Artificial Intelli...
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS188.1x Artificial Intelli...Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS188.1x Artificial Intelli...
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS188.1x Artificial Intelli...Dashamir Hoxha
 
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.2x Advanced Software ...
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.2x Advanced Software ...Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.2x Advanced Software ...
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.2x Advanced Software ...Dashamir Hoxha
 
Certificate -- Dashamir Hoxha -- edX/MITx -- 6.00x Introduction to Computer S...
Certificate -- Dashamir Hoxha -- edX/MITx -- 6.00x Introduction to Computer S...Certificate -- Dashamir Hoxha -- edX/MITx -- 6.00x Introduction to Computer S...
Certificate -- Dashamir Hoxha -- edX/MITx -- 6.00x Introduction to Computer S...Dashamir Hoxha
 
PPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusPPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusDashamir Hoxha
 
PPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusPPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusDashamir Hoxha
 
Using OpenFire With OpenLDAP
Using OpenFire With OpenLDAPUsing OpenFire With OpenLDAP
Using OpenFire With OpenLDAPDashamir Hoxha
 
phpWebApp presentation
phpWebApp presentationphpWebApp presentation
phpWebApp presentationDashamir Hoxha
 
Managing HotSpot Clients With FreeRadius
Managing HotSpot Clients With FreeRadiusManaging HotSpot Clients With FreeRadius
Managing HotSpot Clients With FreeRadiusDashamir Hoxha
 
The Digital Signature and the X.509/OpenPGP Authentication Models
The Digital Signature and the X.509/OpenPGP Authentication ModelsThe Digital Signature and the X.509/OpenPGP Authentication Models
The Digital Signature and the X.509/OpenPGP Authentication ModelsDashamir Hoxha
 
Building a Gateway Server
Building a Gateway ServerBuilding a Gateway Server
Building a Gateway ServerDashamir Hoxha
 
An Algorithm for Incremental Multi-Resolution Modeling
An Algorithm for Incremental Multi-Resolution ModelingAn Algorithm for Incremental Multi-Resolution Modeling
An Algorithm for Incremental Multi-Resolution ModelingDashamir Hoxha
 
SugarCE For Small And Medium Enterprises
SugarCE For Small And Medium EnterprisesSugarCE For Small And Medium Enterprises
SugarCE For Small And Medium EnterprisesDashamir Hoxha
 
B-Translator as a Software Engineering Project
B-Translator as a Software Engineering ProjectB-Translator as a Software Engineering Project
B-Translator as a Software Engineering ProjectDashamir Hoxha
 
B-Translator as a Software Engineering Project
B-Translator as a Software Engineering ProjectB-Translator as a Software Engineering Project
B-Translator as a Software Engineering ProjectDashamir Hoxha
 

Mais de Dashamir Hoxha (20)

Development Setup of B-Translator
Development Setup of B-TranslatorDevelopment Setup of B-Translator
Development Setup of B-Translator
 
Using Drupal Features in B-Translator
Using Drupal Features in B-TranslatorUsing Drupal Features in B-Translator
Using Drupal Features in B-Translator
 
Strategjia për IT-në e Doganës Shqiptare
Strategjia për IT-në e Doganës ShqiptareStrategjia për IT-në e Doganës Shqiptare
Strategjia për IT-në e Doganës Shqiptare
 
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.1x Software as Service
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.1x Software as ServiceCertificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.1x Software as Service
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.1x Software as Service
 
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS188.1x Artificial Intelli...
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS188.1x Artificial Intelli...Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS188.1x Artificial Intelli...
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS188.1x Artificial Intelli...
 
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.2x Advanced Software ...
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.2x Advanced Software ...Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.2x Advanced Software ...
Certificate -- Dashamir Hoxha -- edX/BerkeleyX -- CS169.2x Advanced Software ...
 
Certificate -- Dashamir Hoxha -- edX/MITx -- 6.00x Introduction to Computer S...
Certificate -- Dashamir Hoxha -- edX/MITx -- 6.00x Introduction to Computer S...Certificate -- Dashamir Hoxha -- edX/MITx -- 6.00x Introduction to Computer S...
Certificate -- Dashamir Hoxha -- edX/MITx -- 6.00x Introduction to Computer S...
 
Udhëzuesi i Kturtle
Udhëzuesi i KturtleUdhëzuesi i Kturtle
Udhëzuesi i Kturtle
 
PPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusPPPoE With Mikrotik and Radius
PPPoE With Mikrotik and Radius
 
PPPoE With Mikrotik and Radius
PPPoE With Mikrotik and RadiusPPPoE With Mikrotik and Radius
PPPoE With Mikrotik and Radius
 
Using OpenFire With OpenLDAP
Using OpenFire With OpenLDAPUsing OpenFire With OpenLDAP
Using OpenFire With OpenLDAP
 
phpWebApp presentation
phpWebApp presentationphpWebApp presentation
phpWebApp presentation
 
phpWebApp article
phpWebApp articlephpWebApp article
phpWebApp article
 
Managing HotSpot Clients With FreeRadius
Managing HotSpot Clients With FreeRadiusManaging HotSpot Clients With FreeRadius
Managing HotSpot Clients With FreeRadius
 
The Digital Signature and the X.509/OpenPGP Authentication Models
The Digital Signature and the X.509/OpenPGP Authentication ModelsThe Digital Signature and the X.509/OpenPGP Authentication Models
The Digital Signature and the X.509/OpenPGP Authentication Models
 
Building a Gateway Server
Building a Gateway ServerBuilding a Gateway Server
Building a Gateway Server
 
An Algorithm for Incremental Multi-Resolution Modeling
An Algorithm for Incremental Multi-Resolution ModelingAn Algorithm for Incremental Multi-Resolution Modeling
An Algorithm for Incremental Multi-Resolution Modeling
 
SugarCE For Small And Medium Enterprises
SugarCE For Small And Medium EnterprisesSugarCE For Small And Medium Enterprises
SugarCE For Small And Medium Enterprises
 
B-Translator as a Software Engineering Project
B-Translator as a Software Engineering ProjectB-Translator as a Software Engineering Project
B-Translator as a Software Engineering Project
 
B-Translator as a Software Engineering Project
B-Translator as a Software Engineering ProjectB-Translator as a Software Engineering Project
B-Translator as a Software Engineering Project
 

Último

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 

Último (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 

Easy Blogging With Emacs

  • 1. Easy Blogging With Emacs Time after time I write technical blogs and articles that describe and summarise my experiences. Nowadays all the blogging sites and tools offer WYSIWYG editors. And it makes blogging so easy, right? Not for me! I always find WYSIWYG editing tedious and frustrating. Table Of Contents • Why WYSIWYG sucks • Org-mode of Emacs • Installing Emacs • Using org-mode for writing documents • Publishing the document • Converting the document to PDF Why WYSIWYG Sucks One reason is that you have to make manually every single change (no styles like CSS for example), which makes the process tedious, error prone and inconsistent. If you decide later to change some styles, you have to go all over the document and modify all occurrences one by one… Oh man, better don't touch it at all! But the worst thing about WYSIWYG is that actually its last name is WYGIANWYW (What You Get Is Almost Never What You Want). I have struggled many times with the editor because it would never understand correctly what I wanted and would display a totally broken formatting (long live undo that comes quickly to the rescue). So, I'd rather write plain text HTML than use WYSIWYG editing, unless the structure and formatting of the document is very simple. Maybe not everybody finds WYSIWYG so difficult and annoying, but the technical blogs (articles, documents, etc.) that I write are a bit long and with complex structure, and WYSIWYG would never be suitable for me. I have also tried different wiki systems, which in a sense are better than WYSIWYG, but still they are a bit simple and do not support all the features that I need. Org­Mode Of Emacs After trying different tools and systems, I decided that the orgmode of Emacs is the best for my needs. Quoting from its webpage: "Org mode is for keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system." So, among other things, org-mode can be used for authoring documents, that is writing blogs, articles etc. It has a wiki-like syntax that is lightweight but also complex (not-simple). Combined with the editing power of Emacs it becomes a powerful tool for writing blogs, articles and other docs. Then, it can be converted automatically to other formats, like HTML, LaTeX, PDF, etc.
  • 2. I will try to describe how I use it for my needs (writing blogs, articles, etc.) Installing Emacs On Ubuntu it can be installed like this: sudo apt-get install emacs On other Linux systems it should be very easy too. If you are using Windows, then look at the instructions on this page. The latest versions of Emacs include org-mode by default, so there is no need to do anything special for installing it. Just use the extension .org for the file and the org editing mode will be enabled automatically. Using Org­Mode For Writing Documents Emacs is an advanced editing tool and org-mode has lots of features, however not all of them are needed. For what we want to do (writing technical blogs and docs), we need some very basic and simple things. I will list the ones that I use most frequently: • Paragraphs are marked by empty lines: Paragraph1 Paragraph1 continued Paragraph2 Paragraph2 continued • Headings are marked by stars at the beginning of a line: * Heading1 ** Heading2 *** Heading3 ** Heading2 * Heading1 ** Heading2 • Ordered and unordered lists: + item-1 1. item-1.1 2. item-1.2 3. item-1.3 + item-2 - item-2.1 - item-2.2 - item-2.3 + item-3 • item-1 1. item-1.1 2. item-1.2 3. item-1.3
  • 3. • item-2 1. item-2.1 2. item-2.2 3. item-2.3 • item-3 • Inline markup: *bold*, /italic/, _underlined_, =code= and ~verbatim~ bold, italic, underlined, code and verbatim • Hyperlink: [[http://info.btranslator.org][B-Translator]] B-Translator • Preformatted: #+BEGIN_EXAMPLE Some example from a text file. # +END_EXAMPLE Some example from a text file. It is so simple, intuitive and familiar, that you don't even need a tutorial and can start using it right away. You can find more about the markup that can be used, on the documentation of org-mode (or try info org on the terminal). As an example, you can see the org code of this document itself on gist: easy-blogging-with- emacs.org Publishing The Document In order to publish the document, I do these steps: 1. First, convert it to HTML (with the emacs command: C-c C-e h). 2. Then open the generated HTML file in a browser. 3. And then copy/paste the content of the article from the browser to the editor of the blog site. I don't know why, but a copy/paste like this usually works very well. I use Blogger for my blogs, but I think that it should work on other blog sites and WYSIWYG editors as well. After the copy/paste, I still have to do some minor manual corrections, but this is much easier than writing the whole thing on the WYSIWYG editor. Pay attention to these lines that are at the beginning of the org file: #+OPTIONS: num:nil toc:t ^:nil f:nil TeX:nil LaTeX:nil #+STYLE: <link href="css/org.css" rel="stylesheet" type="text/css"/> They control the look of the generated HTML file. The first one defines some settings/options, like: don't number headers, generate a TOC, turn off TeX syntax for subscripts, etc. More details and other options you can find on the documentation for
  • 4. export settings. The second line tells it which CSS file to use, so that the generated HTML looks nice and beautiful. For a quick start, just download and use my org.css file, and later you can customise it for yourself. For example, it defines the style of preformatted text like this: pre { padding: 10px; border: 1pt solid #AEBDCC; border-radius: 5px; background-color: #000000; color: #eeeeee; font-family: Ubuntu Mono, monospace, courier; } Converting The Document To PDF Org-mode can convert directly to PDF. However there is no way (as far as I know) to modify how the generated PDF file looks like. It always has the same standard look of an old scientific paper (I guess that the conversion to PDF is done by converting first to LaTeX). I prefer to take another approach for generating PDF docs: 1. First I generate the HTML file (where I can control how it looks by customising the CSS file). 2. Then I copy/paste from the browser to LibreOffice (yes, this copy/paste works well too, preserving all the formatting and styles from HTML). 3. Finally save it as PDF. LibreOffice has a built-in PDF converter. However, before the third step I do again some minor manual modifications. I also define styles for headings, preformatted text, text body, etc. One of the things that I change in LibreOffice/PDF document is the style of the preformatted text. In the HTML version it is white font on a black background, and this is good because it looks like a terminal. However PDF documents sometimes can be printed and that style doesn't look nice on paper (and also it would consume lots of ink), so I change it to black font on white background. To apply the new style on a preformatted text, I select it, then from the list of styles (on top-left) select "Clear formatting", then select the style "Preformatted Text". I have to do this for all the preformatted texts. I do the same thing for headings as well. In order to not re-define the styles for each document, I open an old document, replace its content with the new content, and then save it with a new name. This will ensure that the styles of the new document are the same as the styles of the old one. Maybe LibreOffice has some other means for defining the styles and using them on each document, but I am not so familiar with LibreOffice and this trick works anyway. If you want to use my styles, you can download the .odt document from here and use it as a template for your own docs. Author: Dashamir Hoxha <dashohoxha@gmail.com> Date: 12 July 2013 HTML generated by org-mode 6.33x in emacs 23