#pandoc

ysabeau@diaspora-fr.org

Quels outils utiliser pour générer des fichiers #EPUB pour des livres numériques ? C’est orienté #Linux (forcément) mais ça peut le faire aussi pour les autres systèmes. Des trois logiciels que j'ai testé, c'est l'extension pour #LibreOffice, #Writer2xhtml, qui s'en sort le mieux, ensuite #Calibre.

https://dutailly.net/generer-des-fichiers-epub-avec-des-logiciels-libres-et-linux

À compléter avec ce journal sur #LinuxFr où, dans les commentaires, le test a été aussi fait avec #Pandoc (qui ne s'en sort pas si bien en fait).

https://linuxfr.org/users/ysabeau/journaux/plouf-plouf-plouf-c-est-toi-qui-fera-mieux-de-l-epub

dredmorbius@joindiaspora.com

Any Markdown / Pandoc mavens know how to tweak the HTML DOM generated for HTML pages?

I'm looking at one for an article which doesn't seem to generate or elements, though if it did either, would make some layout / CSS issues a lot easier to deal with.

Problem now is that when I set additional margins within <blockquote> segements, they don't really or consistently differ from the adjacent <p> elements. I have a sad.

The CSS I'm using, in part (and yes, I can share the full stylesheet, though this seems to be the operative code):

body {
  margin: 1rem auto;
  max-width: 90rem;
  padding: 0 4rem 0.5rem;
  width: auto;
  font-size: 1rem;
  line-height: 1.4;
}

blockquote {
    margin-left: 8em;
    margin-right: 6em;
}

article, p, ol, ul, li, div {
    width: auto;
    max-width: 45rem;
    margin: 0 auto;
    line-height: 1.4;
}

p {
    margin: 1em auto;
}

What happens is that the blockquote margins are acting against the full page width, and push the blockquote block back and forth across the full page, rather than constraining it within the region bounded by the <p> blocks. Given that the blockquotes aren't within the <p> blocks, that makes sense, but it's not the effect I want.

I'd also like to preserve the option to be able to set elements (images, sidenotes, callouts) within the left or right margins.

I'm thinking that changing the DOM to include an article element would make that easier, as I could set the width of the article or main elements.

Present DOM:

  • html
    • head
    • body
      • header
      • nav
      • p
      • blockquote
      • p
    • body /
  • html /

That would better be:

  • html
    • head
    • body
      • header
      • nav
      • article
      • p
      • blockquote
      • p
      • article /
    • body /
  • html /

("element /" is being used for closing tags)

Looking at HTML5 semantic elements:

  • <section>
  • <nav>
  • <article>
  • <aside>
  • <hgroup>
  • <header>
  • <footer>
  • <time>
  • <mark>

... "article" is what I'm looking for.o

Though ... Dive in to HTML5 doesn't use these: view-source:http://diveinto.html5doctor.com/past.html

But yeah: if I could shim an <article> tag in there, I think I'd be happier.

And yes, I can (and probably will) CodePen this in a bit.

#pandoc #markdown #html #css

dredmorbius@joindiaspora.com

If you're starting to appreciate Markdown: Pandoc

The formatting conventions on Diaspora and other Federation/Fediverse platforms is Markdown, what's called a lightweight markup language. There are several others, including AsciiDoc, which heavily inspired the markup used at Google+.

There is a software utility, Pandoc, available as a command-line tool on Linux, Mac, and (through various command-line tools such as Cygwin) on Windows. It is a document-transformation Swiss army life, capable of converting from and to a vast number of formats, including:

  • From: (several dialects of) Markdown, reStructuredText, textile, HTML, DocBook, LaTeX, MediaWiki markup, TWiki markup, TikiWiki markup, Creole 1.0, Vimwiki markup, OPML, Emacs Org-Mode, Emacs Muse, txt2tags, Microsoft Word docx, LibreOffice ODT, EPUB, or Haddock markup

  • To: not only each of these, but various HTML formats, word processor formats, ebook formats, documentation, archival, page-laoyout, outline TeX, PDF, and others.

I've been working on a documentation project for which I use Pandoc and a Makefile to publish to numerous formats with a single command. Make itself is a tool designed originally for programmers to convert source code to runnable software, but it has all kinds of uses in numerous projects, given its ability to run specific recipes based on goals and dependencies.

When I've discussed my various future plans for online publishing, Pandoc, or tools based on, using, or closely resembling it, are very much what I have in mind as part of my core toolkit.

Pandoc has been the single most useful Linux tool I've discovered in the past five years, if not ten.

#googleplus #pandoc #markdown #writing #documentConversion #HTML #PDF #LaTeX

dredmorbius@joindiaspora.com

A rudimentary G+ post content extractor (JSON format)

Following the YouTube Anschluss in which Google forcibly integrated G+ and YouTube accounts (among other properties), against my express wishes, pretty much forever violating my trust in the company, I made the conscious decision to largely exit G+, removing my content, while archiving what I'd previously posted.

Pulling useful information out of those archives has been ... interesting.

Continued at the dreddit

http://www.reddit.com/r/dredmorbius/comments/21t7im/a_rudimentary_g_post_content_extractor_json_format/

#googleplustips #archives #json #pandoc #shellscripts #linuxhacks