Hi everyone! - I'm excited to introduce a new command that's aimed at enhancing your starting experience with DocC - docc init
.
docc init
aims to make it easier and faster to start with conceptual documentation (article-only) catalogs by providing a starter folder structure and content template with blueprints on good practices regarding documentation creation with DocC.
Motivation
Setting up a DocC catalog is the first step needed to start writing documentation, this is why we want to reduce the entry barrier, making this an easier and effortless process.
While Xcode currently offers the capability to generate catalog templates for API documentation, users aiming to create article-only catalogs have to manually establish the folder structure, and create the `.docc extension folder and markdown or tutorial files. Furthermore, they must determine the organizational structure for their project and search in the DocC documentation how to incorporate a technology root, which serves as the top-level article file. Providing an initial template alleviates the necessity of memorizing and executing these manual steps.
Proposed Solution
Command Usage
DocC Init generates a straightforward catalog template with a recommended file structure, alongside prepopulated placeholder files to facilitate the commencement of documentation creation.
The init command currently takes the following form:
docc init
--catalog-output-path <output path dir>
--documentation-title <documentation title>
--include-tutorial
Here's a breakdown of the command options:
--catalog-output-path <output path dir>
Specifies where to store the catalog. The default is the current directory.--documentation-title <documentation title>
Sets both the name of the catalog directory and the top-level page. The default title is "Documentation".--include-tutorial
(optional). When provided, it incorporates a tutorial template into the resulting catalog.
Template Content
Executing this command results in the creation of a DocC catalog with the following folder structure.
-
|_ Documentation.docc
|â Documentation.md
|â Essentials
| |â getting-started.md
| |â more-information.md
| |_ Resources
|- Tutorial
| |â table-of-contents.tutorial
| |â tutorial-chapter.tutorial
| |_ Resources
|_ Resources
|_ DocC@2x.png
|_ DocC~dark@2x.png
The top-level article provides an example of how to incorporate images, manage content curation, and include the technology root directive.
# Documentation
@Metadata {
@TechnologyRoot
}
<!--@START_MENU_TOKEN@âSummary<!â@END_MENU_TOKEN@-->
## Overview
<!--@START_MENU_TOKEN@âOverview<!â@END_MENU_TOKEN@-->
@Image(source: "DocC.png", alt: "An illustration of the DocC logo.")
## Usage Instructions
To start previewing this documentation run:
`docc preview ___CATALOG_OUTPUT_PATH___`
To generate a doccarchive run:
`docc convert ___CATALOG_OUTPUT_PATH___ -o ___CATALOG_OUTPUT_PATH___`
## Topics
### Essentials
- <doc:getting-started>
- <doc:more-information>
Here, ___CATALOG_OUTPUT_PATH___
will be replaced with the output path of the documentation.
The article is designed to just give some initial directions, but without overloading the template with an excessive amount of content.
Open Questions
- Are there specific elements that developers would find useful to have preconfigured when initiating this type of documentation? (e.g. a directive or a markdown example).
Future Directions
We are considering the implementation of this command in the DocC-Plugin, where the generated catalog will be tied to the targets defined in the developer's package.
Furthermore, we view this as a chance to incorporate additional templates into DocC. This would involve integrating usage scenarios and directive examples while providing practical demonstrations of the different formatting options available. By doing so, we aim to inspire the development of more comprehensive documentation with a conceptual focus.
The initial implementation of docc init is currently under review in this pull request:
Iâm looking forward to hearing your thoughts about this!
-SofĂa