Discussion:
[ale] [OT] Document formatter?
leam hall via Ale
2018-04-02 12:11:32 UTC
Permalink
I'm trying to learn multi-purpose tools. Right now I need something to
document my Ruby code and to also take text based fiction and turn it
into a pdf with bold headers and appropriate page breaks. As a last
resort I can open the text doc in LibreOffice and save as a PDF.

A friend uses Doxygen for his project, I'm looking for some options.
The goal is to be able to run it on the command line.

Suggestions?

Leam
_______________________________________________
Ale mailing list
***@ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
DJ-Pfulio via Ale
2018-04-02 12:28:40 UTC
Permalink
Pandoc?
Post by leam hall via Ale
I'm trying to learn multi-purpose tools. Right now I need something to
document my Ruby code and to also take text based fiction and turn it
into a pdf with bold headers and appropriate page breaks. As a last
resort I can open the text doc in LibreOffice and save as a PDF.
A friend uses Doxygen for his project, I'm looking for some options.
The goal is to be able to run it on the command line.
Suggestions?
_______________________________________________
Ale mailing list
***@ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
leam hall via Ale
2018-04-02 12:32:57 UTC
Permalink
Nice, reading up on it.
Post by DJ-Pfulio via Ale
Pandoc?
Post by leam hall via Ale
I'm trying to learn multi-purpose tools. Right now I need something to
document my Ruby code and to also take text based fiction and turn it
into a pdf with bold headers and appropriate page breaks. As a last
resort I can open the text doc in LibreOffice and save as a PDF.
A friend uses Doxygen for his project, I'm looking for some options.
The goal is to be able to run it on the command line.
Suggestions?
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
_______________________________________________
Ale mailing list
***@ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
James Sumners via Ale
2018-04-02 12:53:59 UTC
Permalink
Pandoc for sure. Just write everything in Markdown and Pandoc will turn it
into whatever you like.
Post by DJ-Pfulio via Ale
Pandoc?
Post by leam hall via Ale
I'm trying to learn multi-purpose tools. Right now I need something to
document my Ruby code and to also take text based fiction and turn it
into a pdf with bold headers and appropriate page breaks. As a last
resort I can open the text doc in LibreOffice and save as a PDF.
A friend uses Doxygen for his project, I'm looking for some options.
The goal is to be able to run it on the command line.
Suggestions?
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
James Sumners
http://james.sumners.info/ (technical profile)
http://jrfom.com/ (personal site)
http://haplo.bandcamp.com/ (music)
DJ-Pfulio via Ale
2018-04-02 13:22:36 UTC
Permalink
I've been using textile instead of MD. Personal choice. Find it is
cleaner and less typing, but much less popular.

Getting PDF output uses a few external programs. I've never bothered to
get it working, but I do generate HTML, TXT, and S5 presentations using
pandoc.

A few examples - to make it easier to get started:

pandoc -s -T "$TITLE" --standalone --slide-level=3 -f textile \
-t plain $ROOT.md -o $ROOT.txt
pandoc -s -T "$TITLE" --toc --standalone --slide-level=3 -f textile \
-t s5 $ROOT.md -o $ROOT.html

If the S5 CSS and JS aren't available, a single HTML file is displayed.
Post by James Sumners via Ale
Pandoc for sure. Just write everything in Markdown and Pandoc will turn
it into whatever you like.
Pandoc?
Post by leam hall via Ale
I'm trying to learn multi-purpose tools. Right now I need something to
document my Ruby code and to also take text based fiction and turn it
into a pdf with bold headers and appropriate page breaks. As a last
resort I can open the text doc in LibreOffice and save as a PDF.
A friend uses Doxygen for his project, I'm looking for some options.
The goal is to be able to run it on the command line.
Suggestions?
_______________________________________________
Ale mailing list
***@ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
Kyle Brieden via Ale
2018-04-02 16:01:38 UTC
Permalink
I'm a little surprised no one here has offered up LaTeX as a tool... I
write my resume in LaTeX and maintain a git repo for it.

---
Very respectfully,
Kyle Brieden
Post by leam hall via Ale
I'm trying to learn multi-purpose tools. Right now I need something to
document my Ruby code and to also take text based fiction and turn it
into a pdf with bold headers and appropriate page breaks. As a last
resort I can open the text doc in LibreOffice and save as a PDF.
A friend uses Doxygen for his project, I'm looking for some options.
The goal is to be able to run it on the command line.
Suggestions?
Leam
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
James Sumners via Ale
2018-04-02 16:24:13 UTC
Permalink
LaTeX isn't a "multi-purpose" tool. LaTeX is for LaTeX. Pandoc can
translate to/from LaTeX amongst many other formats. And Pandoc is *far*
easier to setup and work with than LaTeX. Basically, if you're not
typesetting a book or writing a mathematics paper, LaTeX is too cumbersome.
Post by Kyle Brieden via Ale
I'm a little surprised no one here has offered up LaTeX as a tool... I
write my resume in LaTeX and maintain a git repo for it.
---
Very respectfully,
Kyle Brieden
Post by leam hall via Ale
I'm trying to learn multi-purpose tools. Right now I need something to
document my Ruby code and to also take text based fiction and turn it
into a pdf with bold headers and appropriate page breaks. As a last
resort I can open the text doc in LibreOffice and save as a PDF.
A friend uses Doxygen for his project, I'm looking for some options.
The goal is to be able to run it on the command line.
Suggestions?
Leam
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
--
James Sumners
http://james.sumners.info/ (technical profile)
http://jrfom.com/ (personal site)
http://haplo.bandcamp.com/ (music)
Kyle Brieden via Ale
2018-04-02 16:57:49 UTC
Permalink
Since when has a tool being cumbersome or "not user friendly" stopped
anyone on this list? /s

But seriously, though, that's a fair point. Like I said, I use it for
my resume and some other things that I don't touch often. It's nice
that when I do need to touch them, though, it's a simple edit in vim
(not trying to start that war up again) and then a CLI command and I'm
done. I guess working day to day with it would be more cumbersome
unless you use something like https://www.overleaf.com/ or
https://www.sharelatex.com/

---
Very respectfully,
Kyle Brieden
Post by James Sumners via Ale
LaTeX isn't a "multi-purpose" tool. LaTeX is for LaTeX. Pandoc can
translate to/from LaTeX amongst many other formats. And Pandoc is
*far* easier to setup and work with than LaTeX. Basically, if you're
not typesetting a book or writing a mathematics paper, LaTeX is too
cumbersome.
Post by Kyle Brieden via Ale
I'm a little surprised no one here has offered up LaTeX as a tool...
I write my resume in LaTeX and maintain a git repo for it.
---
Very respectfully,
Kyle Brieden
Post by leam hall via Ale
I'm trying to learn multi-purpose tools. Right now I need
something to
document my Ruby code and to also take text based fiction and turn it
into a pdf with bold headers and appropriate page breaks. As a last
resort I can open the text doc in LibreOffice and save as a PDF.
A friend uses Doxygen for his project, I'm looking for some
options.
The goal is to be able to run it on the command line.
Suggestions?
Leam
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale [1]
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo [2]
_______________________________________________
Ale mailing list
https://mail.ale.org/mailman/listinfo/ale [1]
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo [2]
--
James Sumners
http://james.sumners.info/ (technical profile)
http://jrfom.com/ (personal site)
http://haplo.bandcamp.com/ (music)
------
[1] https://mail.ale.org/mailman/listinfo/ale
[2] http://mail.ale.org/mailman/listinfo
James Sumners via Ale
2018-04-02 17:00:39 UTC
Permalink
https://github.com/jsumners/pandoc_resume :)
Post by Kyle Brieden via Ale
Since when has a tool being cumbersome or "not user friendly" stopped
anyone on this list? /s
But seriously, though, that's a fair point. Like I said, I use it for my
resume and some other things that I don't touch often. It's nice that when
I do need to touch them, though, it's a simple edit in vim (not trying to
start that war up again) and then a CLI command and I'm done. I guess
working day to day with it would be more cumbersome unless you use
something like https://www.overleaf.com/ or https://www.sharelatex.com/
---
Very respectfully,
Kyle Brieden
Steve Litt via Ale
2018-04-02 17:50:13 UTC
Permalink
On Mon, 02 Apr 2018 12:01:38 -0400
Post by Kyle Brieden via Ale
I'm a little surprised no one here has offered up LaTeX as a tool...
I write my resume in LaTeX and maintain a git repo for it.
The trouble with LaTeX is that, without arcane conversion software
(Pandoc, XSLT, etc) or insane amounts of programming, what's written in
LaTeX stays in LaTeX. Turning LaTeX into XML or HTML is a huge parsing
task (or use a complicated converter), but converting XML to LaTeX is
fairly simple, especially if there aren't too many <div> and <span> in
the XML.

LaTeX is perfect if you know you'll always want paper/pdf. But it's
deficient as a write-once, read everywhere content format.

SteveT

Steve Litt
April 2018 featured book: Troubleshooting Techniques
of the Successful Technologist
http://www.troubleshooters.com/techniques
_______________________________________________
Ale mailing list
***@ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
Steve Litt via Ale
2018-04-02 17:21:13 UTC
Permalink
On Mon, 2 Apr 2018 08:11:32 -0400
Post by leam hall via Ale
I'm trying to learn multi-purpose tools. Right now I need something to
document my Ruby code and to also take text based fiction and turn it
into a pdf with bold headers and appropriate page breaks. As a last
resort I can open the text doc in LibreOffice and save as a PDF.
A friend uses Doxygen for his project, I'm looking for some options.
The goal is to be able to run it on the command line.
Suggestions?
Funny you should mention this. Right as we speak, I'm implementing the
standard and conversion software for Stylz, a 100% styles based
authoring format that, when completely implemented, will be write once,
read everywhere. It's like Asciidoc, except it prioritizes quick
authoring and "we do it all for you" a little less than Asciidoc, but
it completely enables use of arbitrary styles. As long as you keep your
style names short, Stylz should author faster than LaTeX, LyX,
LibreOffice. It will be less magical and easier to actually use than
stuff like Pandoc, Docbook, XSLT and the like. Style definition is done
in CSS (html, ePub) or LaTeX (PDF) completely outside of the .stylz
file.

It's implemented as a bunch of tools used at the command prompt.
The .stylz file is converted to a sort of pidgeon XML via two or three
awk programs. These are written already. Once the information is in
XML format, I can have my way with it using an XML parser (leaning
toward Python xml.etree.ElementTree).

Next step are an XML to HTML converter, XML to ePub, and XML to LaTeX
(I'll probably need some help on that one). It would also be possible
to create a Stylz to PDF slide presentation converter. The advantage of
Stylz->Slideshow over Asciidoc/Slidy is that with Stylz, making your
own style to appearance relationships is *much* easier, meaning that
your slideshow looks like *you* want it to look, not the way the authors
of Asciidoc thought would be best.

None of these converters are written yet, although I'm in the
explorational phase of the XML to HTML converter.

Two other handy tools have been written: One to test a file for being
well formed XML, and the other to go through a Stylz file and report
all paragraph and character styles named. This is important when
writing your CSS and LaTeX style definitions, and also, if enabled with
copy and paste, an easy way to get an entire style declaration into
your document while writing new content.

I have a 3 year old, half accurate definition of Stylz here:

http://troubleshooters.com/projects/stylz/

The preceding document is much more featureful and complex than what
I'm doing now: What I'm doing now is a subset of that 3 year old
document. Also, I've decided against directory tree key-value
hierarchies: Those sound so appealing, but when you actually go to
create them, they're slow and error prone. I'll probably have the
document metadata and the build info in Yaml form, or perhaps even the
ancient Windows conf file 2 dimensional things where categories are in
square brackets, with key-value pairs bestriding an equal sign below
them.

Stylz is 100% CLI and will remain so, except possibly for style cut and
paste helpers. You create Stylz in the fastest editor you know: I use
Vim. It's built for mouse-free use, for touch-typists.

Stylz is meant to create long documents with very consistent styles
throughout. In my opinion it would be silly to make resumes or letters
in Stylz: LibreOffice is much better for those things.

Once I get the XML to HTML converter done, Stylz will achieve an MVP
(Minimal Viable Product) for geeky early adopters.

SteveT

Steve Litt
April 2018 featured book: Troubleshooting Techniques
of the Successful Technologist
http://www.troubleshooters.com/techniques
_______________________________________________
Ale mailing list
***@ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
leam hall via Ale
2018-04-02 17:26:50 UTC
Permalink
Post by Steve Litt via Ale
Funny you should mention this.
My current effort is really specific and in Ruby.

https://github.com/makhidkarun/rb_tools/blob/master/bin/build_book

That's why I asked. :)

Leam
_______________________________________________
Ale mailing list
***@ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
Steve Litt via Ale
2018-04-02 18:01:31 UTC
Permalink
On Mon, 2 Apr 2018 13:26:50 -0400
Post by leam hall via Ale
Post by Steve Litt via Ale
Funny you should mention this.
My current effort is really specific and in Ruby.
https://github.com/makhidkarun/rb_tools/blob/master/bin/build_book
That's why I asked. :)
Leam
A couple minutes scanning your program brings me to the conclusion that
your program is meant to write a book of a very specific structure, to
enforce that structure, and compile.

I'm confused as to why you delete and create empty the book_dir and
chapter_dir on every run. What loads the proper stuff in those
directories?

So it looks to me like what you're done when finished is a bunch of
text with no styles. Theoretically, you could write the subdocuments as
Stylz files, run them through Stylz converters, and then put them
together into a whole book. Or put the finished book through Stylz
converter.

What kinds of books are you facilitating writing? It looks like you
have a formula to write a specific genre over and over, which is how a
lot of people make good money.

SteveT

Steve Litt
April 2018 featured book: Troubleshooting Techniques
of the Successful Technologist
http://www.troubleshooters.com/techniques
_______________________________________________
Ale mailing list
***@ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo
leam hall via Ale
2018-04-02 18:12:09 UTC
Permalink
Post by Steve Litt via Ale
On Mon, 2 Apr 2018 13:26:50 -0400
Post by leam hall via Ale
Post by Steve Litt via Ale
Funny you should mention this.
My current effort is really specific and in Ruby.
https://github.com/makhidkarun/rb_tools/blob/master/bin/build_book
That's why I asked. :)
Leam
A couple minutes scanning your program brings me to the conclusion that
your program is meant to write a book of a very specific structure, to
enforce that structure, and compile.
I'm confused as to why you delete and create empty the book_dir and
chapter_dir on every run. What loads the proper stuff in those
directories?
So it looks to me like what you're done when finished is a bunch of
text with no styles. Theoretically, you could write the subdocuments as
Stylz files, run them through Stylz converters, and then put them
together into a whole book. Or put the finished book through Stylz
converter.
What kinds of books are you facilitating writing? It looks like you
have a formula to write a specific genre over and over, which is how a
lot of people make good money.
SteveT
Yup. Writing sci-fi with this being my second revision of the code,
hence the need for a converter. My stuff doesn't mark up the titles
internally or insert page breaks for PDFs. That's a useful thing when
writing technical stuff for work or draft copies for beta readers.

I clean the chapters and book directory just for good house-keeping.
Those two directories aren't stored in git either.

My needs are pretty simple; the first line of the chapter needs to be
bold and when compiled into the book the first line needs to follow a
page break. Chapters are fairly short, word count wise, and often
short in time span.

The reason I asked was that I know I need something, and I also like
to document my code. The hope is to find a common tool.

Leam
_______________________________________________
Ale mailing list
***@ale.org
https://mail.ale.org/mailman/listinfo/ale
See JOBS, ANNOUNCE and SCHOOLS lists at
http://mail.ale.org/mailman/listinfo

Continue reading on narkive:
Loading...