Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document new platform service APIs #31717

Closed
rudolf opened this issue Feb 21, 2019 · 1 comment · Fixed by #32148
Closed

Document new platform service APIs #31717

rudolf opened this issue Feb 21, 2019 · 1 comment · Fixed by #32148
Assignees
Labels
Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc

Comments

@rudolf
Copy link
Contributor

rudolf commented Feb 21, 2019

[WIP]

Get the documentation for the new platform service API's on the elastic documentation website.

Goals:

  • Reuse Elastic's existing documentation infrastructure (based on asciidoc)
  • Lower the barrier to writing good documentation, generate docs as far as possible
  • Should be robust and maintenance free (we want to write docs, not spend time on documentation infrastructure)

Proposal

Use api-extractor and api-documenter to generate documentation from tsdoc comments.

  1. api-extractor
    • Detect a project’s exported API surface
    • Capture the contracts in a concise report designed to facilitate review
    • Warn about common mistakes (e.g. missing exports, inconsistent visibility, etc.)
    • Generate *.d.ts rollups with trimming according to release type
    • Output API documentation in a portable format that’s easy to integrate with your content pipeline
  2. api-documenter
    • Reads *.api.json files created by api-extractor to generate markdown / yml files
    • Has a flexible architecture for supporting custom formats, we could probably easily create an asciidoc emitter based on the markdown emitter

Exactly how we get the docs out of api-documenter into asciidoc still needs to be explored, here are a few options:

  1. api-extractor –> *.api.json file –> api-documenter –> *.md files –> html –> embed in asciidoc
  2. api-extractor –> *.api.json file –> api-documenter –> *.md files –> kramdown-asciidoc –> asciidoc
  3. api-extractor –> *.api.json file –> api-documenter –> new asciidoc generator -> asciidoc

Example markdown and preview using api-extractor and api-documenter. Showing the logger interface since it currently has the most useful documentation.
screenshot 2019-02-26 at 12 22 06

@rudolf rudolf self-assigned this Feb 21, 2019
@rudolf rudolf added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Feature:New Platform labels Feb 21, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:New Platform Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants