From f7bd2ce1a5ef194643b078bd11a90fdf9b389c2b Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Fri, 4 Aug 2023 18:59:28 +0200 Subject: Update Developer Guides (#3088) --- .../architecture/architecture_overview.md | 123 +++++++++ .../architecture/data_model/documentable_model.md | 251 +++++++++++++++++ .../architecture/data_model/extra.md | 91 +++++++ .../architecture/data_model/page_content.md | 144 ++++++++++ .../architecture/extension_points/base_plugin.md | 33 +++ .../extension_points/core_extension_points.md | 103 +++++++ .../extension_points/extension_points.md | 162 +++++++++++ .../extension_points/generation_implementations.md | 40 +++ .../doc/docs/developer_guide/community/slack.md | 7 + .../src/doc/docs/developer_guide/introduction.md | 22 ++ .../plugin-development/introduction.md | 73 +++++ .../plugin-development/sample-plugin-tutorial.md | 297 +++++++++++++++++++++ .../src/doc/docs/developer_guide/workflow.md | 100 +++++++ docs-developer/src/doc/docs/dokka_colors.css | 3 + docs-developer/src/doc/docs/favicon.svg | 10 + docs-developer/src/doc/docs/index.md | 9 + docs-developer/src/doc/mkdocs.yml | 86 ++++++ 17 files changed, 1554 insertions(+) create mode 100644 docs-developer/src/doc/docs/developer_guide/architecture/architecture_overview.md create mode 100644 docs-developer/src/doc/docs/developer_guide/architecture/data_model/documentable_model.md create mode 100644 docs-developer/src/doc/docs/developer_guide/architecture/data_model/extra.md create mode 100644 docs-developer/src/doc/docs/developer_guide/architecture/data_model/page_content.md create mode 100644 docs-developer/src/doc/docs/developer_guide/architecture/extension_points/base_plugin.md create mode 100644 docs-developer/src/doc/docs/developer_guide/architecture/extension_points/core_extension_points.md create mode 100644 docs-developer/src/doc/docs/developer_guide/architecture/extension_points/extension_points.md create mode 100644 docs-developer/src/doc/docs/developer_guide/architecture/extension_points/generation_implementations.md create mode 100644 docs-developer/src/doc/docs/developer_guide/community/slack.md create mode 100644 docs-developer/src/doc/docs/developer_guide/introduction.md create mode 100644 docs-developer/src/doc/docs/developer_guide/plugin-development/introduction.md create mode 100644 docs-developer/src/doc/docs/developer_guide/plugin-development/sample-plugin-tutorial.md create mode 100644 docs-developer/src/doc/docs/developer_guide/workflow.md create mode 100644 docs-developer/src/doc/docs/dokka_colors.css create mode 100755 docs-developer/src/doc/docs/favicon.svg create mode 100644 docs-developer/src/doc/docs/index.md create mode 100644 docs-developer/src/doc/mkdocs.yml (limited to 'docs-developer/src') diff --git a/docs-developer/src/doc/docs/developer_guide/architecture/architecture_overview.md b/docs-developer/src/doc/docs/developer_guide/architecture/architecture_overview.md new file mode 100644 index 00000000..d72dda91 --- /dev/null +++ b/docs-developer/src/doc/docs/developer_guide/architecture/architecture_overview.md @@ -0,0 +1,123 @@ +# Architecture overview + +Normally, you would think that a tool like Dokka simply parses some programming language sources and generates +HTML pages for whatever it sees along the way, with little to no abstractions. That would be the simplest and +the most straightforward way to implement an API documentation engine. + +However, it was clear that Dokka may need to generate documentation from various sources (not only Kotlin), that users +might request additional output formats (like Markdown), that users might need additional features like supporting +custom KDoc tags or rendering [mermaid.js](https://mermaid.js.org/) diagrams - all these things would require changing +a lot of code inside Dokka itself if all solutions were hardcoded. + +For this reason, Dokka was built from the ground up to be easily extensible and customizable by adding several layers +of abstractions to the data model, and by providing pluggable extension points, giving you the ability to introduce +selective changes on a given level. + +## Overview of data model + +Generating API documentation begins with input source files (`.kt`, `.java`, etc) and ends with some output files +(`.html`/`.md`, etc). However, to allow for extensibility and customization, several input and output independent +abstractions have been added to the data model. + +Below you can find the general pipeline of processing data gathered from sources and the explanation for each stage. + +```mermaid +flowchart TD + Input --> Documentables --> Pages --> Output +``` + +* `Input` - generalization of sources, by default Kotlin / Java sources, but could be virtually anything +* [`Documentables`](data_model/documentable_model.md) - unified data model that represents _any_ parsed sources as a + tree, independent of the source language. Examples of a `Documentable`: class, function, package, property, etc +* [`Pages`](data_model/page_content.md) - universal model that represents output pages (e.g a function/property page) + and the content it's composed of (lists, text, code blocks) that the users needs to see. Not to be confused with + `.html` pages. Goes hand in hand with the so-called [Content model](data_model/page_content.md#content-model). +* `Output` - specific output formats like HTML / Markdown / Javadoc and so on. This is a mapping of the pages/content + model to a human-readable and visual representation. For instance: + * `PageNode` is mapped as + * `.html` file for the HTML format + * `.md` file for the Markdown format + * `ContentList` is mapped as + * `
  • ` / `