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

docs: fix example not following best practice and relation tuple syntax highlighting #582

Merged
merged 5 commits into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/docs/concepts/graph-of-relations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ readability. In practice, the namespace always has to be considered.
// user1 has access on dir1
dir1#access@user1
// Have a look on the subjects concept page if you don't know the empty relation.
dir1#parent@(file1#)
dir1#child@(file1#)
// Everyone with access to dir1 has access to file1. This would probably be defined
// through a subject set rewrite that defines this inherited relation globally.
// In this example, we define this tuple explicitly.
Expand All @@ -54,8 +54,8 @@ This is represented by the following graph:
chart={`
graph TD
subgraph obj [Object region]
A[file1]
E[dir1] -->|parent| A
E[dir1]
A[file1] -->|child| E
G[file2]
end
subgraph subjID [Subject ID region]
Expand Down
51 changes: 50 additions & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ if (fs.existsSync('./src/css/theme.css')) {
customCss.push(require.resolve('./src/css/theme.css'))
}

const githubPrismTheme = require('prism-react-renderer/themes/github')

module.exports = {
title: config.projectName,
tagline: config.projectTagLine,
Expand All @@ -52,7 +54,54 @@ module.exports = {
projectName: config.projectSlug, // Usually your repo name.
themeConfig: {
prism: {
theme: require('prism-react-renderer/themes/github'),
theme: {
zepatrik marked this conversation as resolved.
Show resolved Hide resolved
...githubPrismTheme,
styles: [
...githubPrismTheme.styles,
{
languages: ['keto-relation-tuples'],
types: ['namespace'],
style: {
color: '#666'
}
},
{
languages: ['keto-relation-tuples'],
types: ['object'],
style: {
color: '#939'
}
},
{
languages: ['keto-relation-tuples'],
types: ['relation'],
style: {
color: '#e80'
}
},
{
languages: ['keto-relation-tuples'],
types: ['delimiter'],
style: {
color: '#555'
}
},
{
languages: ['keto-relation-tuples'],
types: ['comment'],
style: {
color: '#999'
}
},
{
languages: ['keto-relation-tuples'],
types: ['subject'],
style: {
color: '#903'
}
}
]
},
darkTheme: require('prism-react-renderer/themes/dracula'),
additionalLanguages: ['pug', 'shell-session']
},
Expand Down
Loading