Skip to content

Commit

Permalink
feat: docs (#26)
Browse files Browse the repository at this point in the history
* docs: setup Nextra

* feat(docs): ERdoc syntax highlighting in markdown!

* docs: intro, entity, weak entities docs

* docs: relationship and aggregation syntax docs

* fix(Header): Open links in new tab; website title

* spelling

* fix(docs): don't use SVG images. Spelling.

With SVG images, the text of some nodes overflowed when viewing the page
in my laptop
  • Loading branch information
matias-lg authored Nov 2, 2023
1 parent 3d208c4 commit 23975ee
Show file tree
Hide file tree
Showing 29 changed files with 7,527 additions and 2,096 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

# COPY --from=builder /app/public ./public
COPY --from=builder /app/public ./public

# Set the correct permission for prerender cache
RUN mkdir .next
Expand Down
25 changes: 25 additions & 0 deletions docs.config.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";

const DocsConfig = {
project: {
link: "https://github.com/matias-lg/er",
},
docsRepositoryBase: "https://github.com/matias-lg/er/tree/main",
logo: <span style={{ fontWeight: 800 }}>ERdoc Playground</span>,
useNextSeoProps: () => ({
titleTemplate: "%s",
}),
footer: {
text: (
<span>
MIT {new Date().getFullYear()} ©{" "}
<a href="https://github.com/matias-lg/er" target="_blank">
ERdoc Playground
</a>
.
</span>
),
},
};

export default DocsConfig;
29 changes: 27 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
module.exports = {
const { getHighlighter, BUNDLED_LANGUAGES } = require("shiki");

const withNextra = require("nextra")({
theme: "nextra-theme-docs",
themeConfig: "./docs.config.tsx",
mdxOptions: {
rehypePrettyCodeOptions: {
getHighlighter: (options) =>
getHighlighter({
...options,
langs: [
...BUNDLED_LANGUAGES,
// setup syntax highlighting for erdoc code blocks
{
id: "erdoc",
scopeName: "source.erdoc",
aliases: ["erdoc"],
path: "../../public/erdoc_grammar.tmLanguage.json",
},
],
}),
},
},
});

module.exports = withNextra({
output: "standalone",
};
});
Loading

0 comments on commit 23975ee

Please sign in to comment.