💾 Archived View for d.moonfire.us › blog › 2014 › 08 › 02 › author-intrusion-cli-and-black-triangle captured on 2022-01-08 at 13:41:32. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
Over the last week, I've been working on the current version of Author Intrusion[1]. It can get pretty discouraging since there is so much to do, so I'm focusing on a single task at a time and building out along the way so I will hopefully get a complete project by the end.
One of the hardest things about coding is the GUI. There are so many things for getting events hooked up and the interface running smoothly. Being that GUIs are my weakest area of code, plus the state of the cross-platform .NET UI libraries is still a little weak, I'm going to work on other things.
I ended up deciding on project IO. For those who have read my blog in the post, you probably remember that I spend a lot of time working on automated the creation of ebooks and print from my source documents. Not to mention a lot of time working on creating a format that works the way I like to work.
That lead into my first goal: transforming a source project into another format. Eventually, this is going to lead into system used to create ODT, Microsoft Word, EPUB, MOBI, and everything else. Not to mention importing from other formats.
While I'm going to eventually have a GUI interface for it, I can also write a command-line interface (CLI) version which lets me get the functionality written without getting distracted by the GUI.
This weekend, I actually saw the beginning of my ideas show up. The initial framework for converting a Markdown[2] file into DocBook 5[3] worked via the CLI.
2: http://daringfireball.net/projects/markdown/
3: http://www.docbook.org/tdg5/en/html/docbook.html
$ aicli transform sample.markdown sample.xml
I went with `aicli` (Author Intrusion CLI) for the tool. The interface is inspired by Git[4] with sub-commands and a somewhat flexible way of adding new tools.
The cool part is that the above command actually worked. It doesn't look like much, but there weeks of effort to get to that point. It's a black triangle[5] moment in this development.
5: http://philosophistry.com/archives/2009/01/what-is-a-black.html
I arranged the file formats into, creatively enough, `IBufferFormat` objects. They are discovered via an IoC[6] container (StructureMap[7]) and represent a single type of input or output.
6: http://en.wikipedia.org/wiki/Inversion_of_control
7: http://docs.structuremap.net/
The initial ones to get the above code working were:
I'll get these to be both input and output, that way anyone can use either Markdown or DocBook files for their primary project format. I'll also use these for the output formats:
Yeah, the other bit I like is the single configurable option.
$ aicli transform sample.markdown sample.xml -ORootElement=chapter
There may be more, but that puts me one step closer to replacing `mfgames-creole docbook` that I originally wrote for MfGames Writing Python[8].
8: https://github.com/dmoonfire/mfgames-writing-python
Categories:
Tags:
Below are various useful links within this site and to related sites (not all have been converted over to Gemini).
https://d.moonfire.us/blog/2014/08/02/author-intrusion-cli-and-black-triangle/