Codewriting is an open, hopefully collaborative writing project to document current best practices and forward thinking in the field of technical communications, specifically documentation for software projects.
A manual for establishing optimal documentation environments, Codewriting explores the “docs-as-code” or “DocOps” approach to documenting and instructing software. This iteratively written, open-source volume explores the unconventional strategies in use by many of today’s hottest startups and teams at several tech-industry stalwarts.
As a living, collaborative document, Codewriting employs many of the techniques it teaches — written in lightweight markup, this book’s codebase (its text) can be forked and modified by anyone for any reason other than direct profit (see the Creative Commons ShareAlike license).
Codewriting is for the tech writer and engineer alike, and it covers systems that involve everyone in the development circle, such as DevOps, project management, quality assurance, and product ownership. Coders and writers will find advice for integrating the others' skills and tools for building better docs, as well as improved collaboration around docs and interfaces, user- and developer-facing alike. From writing and docs-planning techniques to blending the product’s build and content source, Codewriting is about upgrading how we communicate the products we make.
The briandominick/codewriting
repo contains much more than just the Codewriting book source.
This is also the home of codewriting.org, which includes a blog and informational pages about DocOps tools and techniques.
All of this is built from a fairly robust codebase mixing mostly YAML and AsciiDoc files, configured to be processed by powerful build/publish tools.
This repo can serve as a framework on which to base your own site with a self-contained build operation for turning complex source and data into a professional web presence, all using free, open source tools.
Please, be my guest, and modify to your heart’s content.
These tools include:
-
Jekyll, a popular static site generator
-
Asciidoctor parsing engine for AsciiDoc files
-
LiquiDoc, my own tool, which I use for preprocessing YAML data and configuring complicated build procedures
-
Git — if you don’t know it yet, the time has come
Note
|
Do Not Be Intimidated
Most of these tools happen to be sourced in Ruby and run primarily in a Ruby environment using each tool’s built-in command-line interface.
First, you do not have to know any Ruby to use these tools.
Moreover, they will help you become comfortable using Bash shell utilities and command prompts generally.
If you want to learn more about how these tools work, we’ll be exploring LiquiDoc, Jekyll, and several tools from the Asciidoctor ecosystem, as well as many others, all in these pages.
|
The book and website are written in lightweight markup languages. That means content starts as source code, which must be compiled to a cohesive document in a friendlier format for reading. If you try merely reading it as file pages on GitHub, you’ll be missing a lot, even though GitHub plays somewhat nice with AsciiDoc.
Codewriting is totally free, and the latest public draft will always be made available here — all you have to do is “pull” the source repository and run a simple command to build a 1-page HTML page or PDF document. Here is how.
In order to operate the publishing tool included in this repo, you’ll need Ruby. If you’re on a Mac OSX or Linux system, you likely have an appropriate version of Ruby installed.
For Windows, download and run RubyInstaller.
Tip
|
Git FTW
To really engage with this book, you will want to use Git. To set up Git, go to the Git downloads page and select your operating system. If you are brand new to Git, check out GitHub’s Try Git tutorial. |
The last tool you need is your preferred terminal/command prompt (Windows instructions, Mac instructions).
-
In the terminal, navigate to a workspace directory.
Example (any directory will do)cd Documents/workspace
-
Clone this repo.
git clone [email protected]:briandominick/codewriting.git
TipIf you don’t wish to run Git and clone the repo, you can always download and unzip the archive of this repo anywhere on your hard drive, then continue these instructions. -
Change directory to the repo.
cd codewriting
-
Run Bundler’s install command to establish local Ruby gem dependencies.
bundle install
If Bundler is not installed, run
gem install bundler
, then repeat this step. Bundler is a package manager for Ruby gems; it will ensure you always have the right dependencies installed. -
Build the book in PDF and HTML, as well as the site and my resumé.
bundle exec liquidoc -c _configs/build-global.yml
Now you can open _build/publish/codewriting-book-draft.html
in your preferred browser or open _build/publish/codewriting-book-draft.pdf
in your favorite PDF viewer.
Please give this latest draft a read and let me know what you think!
The other contents of _build/
are yours to peruse.
Also check out the files in _configs/
, data/
, and _templates/
, as well as all the AsciiDoc files in book-cw/
.
Tip
|
To learn more about the build tool, explore the files in the LiquiDoc repo! This is my first ever Ruby scripting project; it’s not terribly complex, and there’s lots more to come. |
You can also perform a Jekyll build/serve operation against the _build/
directory.
To do so using the included Jekyll config, still from the root directory:
bundle exec jekyll serve --config _configs/jekyll.yml --no-watch --skip-initial-build
Now browse to http://127.0.0.1:4004
— you should see the codewriting.org
website.
To keep updated, follow this repo on GitHub.
Note
|
For more about the build scripts and the overall framework (what goes where), see Framework and Build below or check out LiquiDoc CMF directly. |
All proposed edits and additions are eagerly welcomed.
Here are some forms of content contributions I would love to receive:
- quotations
-
Quote yourself as if I interviewed you for three hours and kept some of your best advice. Write yourself right into the text, either with an outright quote or a paraphrase.
- guest blocks
-
Make a text block that conveys your commentary on a topic, in context.
The two main types of block contributions are admonition blocks (either generic or branded) and guest sidebars, for longer prose.
- admonition block
-
You can either author a generic admonition, to be credited in the Acknowledgements and the Git repo, or you can brand an admonition with your name (or GH username) and mug. Admonition blocks should be kept to one short paragraph, at most.
- generic admonition
[TIP] Here is my opinion about this topic.
- branded admonition
[BRANDED.yourGHusername] I'll make this do something cool by the time we “go to press”.
In this case, also place a 150x150 pixel PNG file to use as an avatar for you. Make it your headshot or a caricature or some symbol you want to rep your mug. Name it
yourGHusername.png
and place it inbook-cw/images/avatars
. - guest sidebar
-
Make a sidebar for multi-paragraph contributions.
[guest_contribution] .Your Sidebar's Clever Title **** Here is the text of your sidebar. Keep it witty, and remember to use one-sentence-per-line and other styles from the Style Guide. You can use paragraphing, images, tables, and so forth. Just keep it tidy, witty, and informative. -- Tag Yourself (link:https://twitter.com/@memememe[memememe]) ****
To make these items most modular, it is best that you contribute them in their own filename.adoc
file.
Your pull request is welcome to also incorporate the include::filename.adoc[]
macro in the place you think your content best fits.
Otherwise, it’s fine to leave it for me to suggest a placement.
Here are the technical steps to contributing. If you don’t know how to use Git or AsciiDoc yet, you may wish to read the book before trying to contribute. In fact, that’s a good general recommendation, so you don’t duplicate something that’s already included, and so you can enhance existing content — even by contradicting it sensibly.
-
Fork the GitHub repo.
-
Create a branch.
If you clone your newly forked repo to your local machine (similarly to the procedure for cloning this repo, above), use
git checkout -b new-branch
, wherenew-branch
is a descriptive name for your contribution (e.g.,sidebar-hacking
). -
Edit the appropriate AsciiDoc file, or create and properly include a new one.
-
Build locally to make sure your contribution builds as both PDF and HTML.
-
Issue a pull request to my repo.
https://github.com/briandominick/codewriting -
I’ll review your contribution and respond to it as soon as I can.
Tip
|
If you wish to propose a contribution before you start writing/coding, create an Issue and label it proposal .
I’ll review it and let you know what I think.
|
Only once we’re both happy with the final state of a proposed change will I incorporate any of your work, and all contributors will be prominently credited, as well as remain in the git log for all eternity.
One of the commits in your first PR should add yourself to the appropriate contributors' list in book-cw/frontmatter/acknowledgements.adoc
.
I do reserve the right to include lessons from your contributions even if we cannot agree on the specific final text; any particular ideas reflected will be duly credited. As a journalist in my past life, I was fanatical about attribution, accuracy, and integrity in news media. As evidence, I submit this journalism guide) I helped write. I assure you I take proper representation and credit very seriously.
- Words!
-
Lots more content coming, across several chapters
- Slides!
-
I want to make a bulleted summary of each chapter/section as a “slide”, which can be included in each section as well as compiled into a slide deck for presentations. I hope others will modify them to their liking and make use of them spreading the word about DocOps!
- Exercises
-
I am working on a narrative about a docs-focused startup that hires the reader as Employee #3. Hijinks ensue.
Here are some notes on what goes where and how it’s all built.
├── _build/ (1)
│ └── publish/
├── _configs/ (2)
│ ├── asciidoctor.yml
│ ├── build-global.yml
│ └── jekyll.yml
├── _posts/ (3)
├── _templates/ (4)
│ └── liquid/
├── assets/ (5)
├── book-cw/ (6)
│ ├── _configs/ (7)
│ ├── _data/ (8)
│ ├── <content_directories>/ (9)
│ ├── includes/ (10)
│ └── index-book-cw.adoc (11)
├── data/ (12)
│ ├── attributes.yml
│ ├── dependencies.yml
│ ├── glossary.yml
│ ├── item-lists.yml
│ └── dominick.yml
├── pages/ (13)
├── theme/ (14)
├── Gemfile (15)
├── LICENSE.md (16)
└── README.adoc (17)
-
The scratch directory in which all preprocessing files are handled and final artifacts located
-
Configuration files for build tools, including Asciidoctor, Jekyll, and LiquiDoc (
build-global.yml
instructs the main build routine) -
Blog posts for the site
-
Templates used for prebuilding content files (no site theme or page structure)
-
Images, AsciiDoc includes, and other content used directly in output, possibly for multiple documents
-
Book content files; everything that goes in the book
-
Build configurations for the book’s precompiled source files
-
Data source files for the book, for building complex content
-
Discrete content files (topics, source samples, etc)
-
Snippets and partials for the book
-
The book’s content map
-
Structured data files for the whole project (not just the book)
-
Site content that doesn’t go in the book
-
Files used to style output for the whole site
-
The project’s Ruby dependency collection
-
The Creative Commons license and description of what is covered
-
Whoa, that’s like, the source for what you’re reading right now…
As of January 2019, Codewriting.org is built and served by Netlify. Netlify’s free service is simply amazing; I cannot recommend it strongly enough. All I do is point it to the repo, enter the build command, and tell it where to get the built files to serve. Nelify inegrates automatically with GitHub and analyzes the site output for security and integrity. All this pretty much out of the box, with free HTTPS and custom domain-name handling.
The Codewriting codebase is covered by the "Creative Commons ShareAlike 3.0 Unported" license, except as noted in the NOTICE of third-party software dependencies.
You are encouraged to copy and modify this content for your own purposes; just please link back to codewriting.org.
For details, see LICENSE.md
for full details and complete license text.