Skip to content

Latest commit

 

History

History
executable file
·
106 lines (66 loc) · 6.95 KB

rules_and_macros_overview.md

File metadata and controls

executable file
·
106 lines (66 loc) · 6.95 KB

Rules and Macros

The rules and macros described below are used to maintain markdown files.

On this page:

markdown_check_links_test

markdown_check_links_test(name, config, data, max_econnreset_retry_count, quiet, srcs, verbose)

Using markdown-link-check, check the links in a markdown file to ensure that they are valid.

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
config A markdown-link-check JSON configuration file. Label optional @cgrindel_bazel_starlib//markdown:default_markdown_link_check_config
data Any data files that need to be present for the link check to succeed. List of labels optional []
max_econnreset_retry_count The maximum number of times to retry on an ECONNRESET error. Integer optional 3
quiet If set to true, the markdown-link-check will be configured to only display errors. Boolean optional True
srcs The markdown files that should be checked. If no srcs are provided, all of the markdown files (.md, .markdown) in the data will be checked. List of labels optional []
verbose If set to true, the markdown-link-check will be configured for verbose output. Boolean optional False

markdown_generate_toc

markdown_generate_toc(name, output_suffix, remove_toc_header_entry, srcs, toc_header)

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this target. Name required
output_suffix The suffix added to the output file with the updated TOC. String optional ".toc_updated"
remove_toc_header_entry Specifies whether the header for the TOC should be removed from the TOC. Boolean optional True
srcs The markdown files that will be updated with a table of contents. List of labels required
toc_header The header that leads the TOC. String optional "Table of Contents"

markdown_pkg

markdown_pkg(name, srcs, toc_visibility, update_visibility, define_doc_files, doc_files_visibility,
             additional_doc_files)

Adds targets to maintain markdown files in the package.

This macro adds targets to generate a table of contents (TOC) for markdown files (markdown_generate_toc), adds diff_test targets to confirm that the markdown files are up-to-date with the latest TOC, adds a target to update the markdown files with the generated files (updatesrc_update) and defines a filegroup that is useful to collecting documentation files for confirming that a markdown files links are valid (markdown_check_links_test)

PARAMETERS

Name Description Default Value
name A prefix string that will be added to all of the targets defined by this macro. "markdown"
srcs Optional. The markdown sources to be used by the macro. If none are specified, all of the .md and .markdown files are used. None
toc_visibility Optional. The visibility for the TOC generation targets. None
update_visibility Optional. The visibility for the update target. None
define_doc_files Optional. A bool that specifies whether to define a filegroup that can be used for documentation validity tests. True
doc_files_visibility Optional. The visibility for the documentation filegroup target. ["@//:subpackages"]
additional_doc_files Optional. Additional files that should be included in the documentation filegroup. []

markdown_register_node_deps

markdown_register_node_deps(name)

Configures the installation of the Javascript node dependencies for the markdown functionality.

PARAMETERS

Name Description Default Value
name Optional. The name of the yarn repository that will be defined. "cgrindel_bazel_starlib_markdown_npm"