Magidoc
repository·main·Indexed 43 days ago
https://github.com/magidoc-org/magidocA fast, customizable static documentation website generator for GraphQL schemas based on Svelte. Version 7.0.0 automates the creation of API documentation for queries, mutations, and types, offering a plugin system for infinite customization, fuzzy search via FuseJS, and support for multi-schema setups.
What's inside Magidoc
- Magidoc is a JavaScript library designed to auto-generate static documentation from any GraphQL schema. It automatically creates documentation for every query, mutation, subscription, and type within your API. It is designed to be fast, customizable, and provides features like fuzzy search, SEO support, live hot-reloading during development, and advanced Markdown support for schema comments and custom pages.
Overview of Magidoc - Svelte PrismJS
mainMagidoc - Svelte PrismJS is a TypeScript-based library designed for Svelte and SvelteKit applications. It provides reactive syntax highlighting using PrismJS. The plugin is fully reactive, meaning it automatically re-highlights code whenever the language or the code content changes.What is Magidoc?
mainMagidoc is a free, open-source static documentation website generator specifically designed for GraphQL. It provides templates and a plugin system to create searchable, highly discoverable documentation that goes beyond simple schema exploration. Unlike web IDEs (like GraphiQL) which focus on schema interaction, Magidoc is designed to present concepts, workflows, authentication mechanisms, and usage examples in a structured documentation format.Overview of Magidoc - Reverse-Schema-Mapper
mainThe
Reverse-Schema-Mapperis a library designed to perform reverse mapping of a GraphQL Schema. It provides two primary capabilities:- Type Reference Discovery: Identify where specific types are used or referenced within a GraphQL Schema.
- Query Path Discovery: Build a reverse tree of the GraphQL Schema to determine the exact query path required to reach a specific field.
Note: This plugin is currently under development and is not considered production-ready.
Overview of Magidoc - Svelte Marked
mainSvelte-Marked is a markdown parser designed to render markdown directly into Svelte components. It provides built-in support for GitHub Flavored Markdown (GFM), including features like tables, lists, and raw HTML.
Key capabilities:
- Customization: You can overwrite individual component renderers to customize the styling of specific markdown elements.
- Extensibility: You can register marked extensions to support advanced or custom markdown syntax.
- Compatibility: It is compatible with any Svelte or SvelteKit application.
Overview of Magidoc - Fuse GraphQL
mainThe@magidoc/plugin-fuse-graphqllibrary indexes GraphQL schemas into a FuseJS search engine. It achieves this by indexing every query, mutation, subscription, and type within the schema. To ensure high-quality search results, all descriptions are processed through a markdown engine to extract only the relevant text for indexing. This plugin is environment-agnostic and can be used in both browser and Node.js applications.What is Magidoc - Query Generator
mainMagidoc - Query Generator is a library designed to generate GraphQL Queries automatically from a provided GraphQL Schema and a specific root field. This capability allows developers to dynamically build functional queries for their APIs, making it a valuable tool for automated testing or generating documentation examples.Overview of Magidoc documentation website
mainMagidoc is used to build static documentation websites. The documentation site hosted on GitHub Pages is built using the Magidoc CLI, specifically generating custom pages.Explore Magidoc usage examples
mainThe
examplesdirectory provides concrete implementations of Magidoc to help you understand how to configure and build different types of documentation sites.Key examples include:
- SpaceX: A template for generating a basic website based on a public SpaceX GraphQL API. This is the same template used for the official Magidoc demo website.
- Multi-Schema: Demonstrates how to generate a Magidoc website that incorporates multiple different GraphQL schemas and how to link them together into a single, unified documentation site.
Use the Magidoc CLI to generate GraphQL documentation websites
mainMagidoc CLI is a Node.js-based command-line application designed to generate beautiful, fully customizable documentation websites from GraphQL schemas. It serves as the primary interface for orchestrating the documentation generation process.Use @magidoc/rollup-plugin-gql-schema for GraphQL schemas
mainThe
@magidoc/rollup-plugin-gql-schemais a Rollup and ViteJS plugin designed to manage GraphQL schemas. It provides two primary capabilities:- Fetching: It can fetch a GraphQL schema from a remote endpoint. You can configure the
url, HTTPmethod, customheaders, and the desiredoutput format. - Parsing: It can parse local GraphQL schema files. It supports aggregating multiple schema parts into a single file using glob patterns or specific custom file paths.
This plugin is compatible with both browser-based and NodeJS-based projects that utilize Rollup or ViteJS.
- Fetching: It can fetch a GraphQL schema from a remote endpoint. You can configure the
What is the Magidoc - Fuse Markdown plugin?
mainThe
fuse-markdownplugin indexes Markdown content into a FuseJS engine.To enable granular searching, the plugin splits Markdown content into separate documents based on headers. Each section (the content following a header) is indexed as an individual document. This allows users to identify which specific section a search result belongs to and search for content within specific sections.