-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tools:doc] Add Doc::RootDoc and support for
.mystdoc.yml
.
`.mystdoc.yml` is a file that specifies some metadata to include during documentation generation, including the name of the project, a version string, a homepage url, and a logo url. These can all be used by documentation renderers, then, to provide a more complete, customizable experience for individual projects.
- Loading branch information
1 parent
017c6c7
commit 79fc005
Showing
6 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
project_name: Myst | ||
version: v0.6.0 | ||
homepage_url: https://myst-lang.org | ||
logo_url: https://avatars2.githubusercontent.com/u/29179527?s=200&v=4 | ||
doc: | | ||
Myst is a dynamic, general-purpose programming language. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
module Myst | ||
module Doc | ||
enum Kind | ||
ROOT | ||
CONSTANT | ||
METHOD | ||
MODULE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
require "yaml" | ||
|
||
module Myst | ||
module Doc | ||
class RootDoc | ||
property kind = Kind::ROOT | ||
# These properties are meta information about the project being | ||
# documented. These are pulled from the `.mystdoc.yml` file in the | ||
# project's directory if one exists. Otherwise, they are mostly left nil. | ||
property project_name : String? = nil | ||
property version : String? = nil | ||
property homepage_url : String? = nil | ||
property logo_url : String? = nil | ||
property doc : String? = nil | ||
|
||
|
||
# These properties essentially mirror ModuleDoc and are generated by | ||
# the tool's scan of Myst source files. | ||
property submodules = {} of String => ModuleDoc | ||
property subtypes = {} of String => TypeDoc | ||
property constants = {} of String => ConstDoc | ||
property methods = {} of String => MethodDoc | ||
|
||
|
||
JSON.mapping( | ||
kind: Kind, | ||
project_name: {type: String?, emit_null: true}, | ||
version: {type: String?, emit_null: true}, | ||
homepage_url: {type: String?, emit_null: true}, | ||
logo_url: {type: String?, emit_null: true}, | ||
doc: {type: String?, emit_null: true}, | ||
submodules: Hash(String, ModuleDoc), | ||
subtypes: Hash(String, TypeDoc), | ||
constants: Hash(String, ConstDoc), | ||
methods: Hash(String, MethodDoc) | ||
) | ||
|
||
YAML.mapping( | ||
project_name: String?, | ||
version: String?, | ||
homepage_url: String?, | ||
logo_url: String?, | ||
doc: String? | ||
) | ||
|
||
|
||
def initialize | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters