Skip to content

Commit

Permalink
Add custom syntax highlighting style
Browse files Browse the repository at this point in the history
  • Loading branch information
danilopeixoto committed Dec 24, 2021
1 parent 221d20c commit 204cdc4
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 14 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- Local credential store
- Vault credential store
- File metadata store (local and S3)
- Amundsen metadata store
- OpenMetadata metadata store
- File data source (local and S3)
- PostgreSQL data source
- Teradata data source
Expand Down
45 changes: 45 additions & 0 deletions docs/metastore/_pygments/style.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
'''
Pygments styles.
'''

from pygments.style import Style
from pygments.token import (
Comment,
Operator,
Name,
Keyword,
String,
Literal,
Number,
Error
)


class MetastoreStyle(Style):
'''
Metastore syntax highlighting style.
'''

default_style = ''

styles = {
Comment: '#666f78',
Comment.Preproc: '#666f78',
Operator: '#000000',
Name: '#000000',
Name.Builtin: 'bold #015493',
Name.Builtin.Pseudo: 'bold #015493',
Name.Variable: '#000000',
Name.Tag: 'bold #015493',
Name.Decorator: '#000000',
Name.Label: '#000000',
Name.Attribute: '#000000',
Name.Class: '#000000',
Name.Function: '#000000',
Keyword: 'bold #015493',
String: '#dd2458',
String.Char: '#dd2458',
Literal: '#009b44',
Number: '#009b44',
Error: '#000000'
}
28 changes: 16 additions & 12 deletions docs/metastore/_static/styles/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,27 @@
--pst-color-headerlink: 0, 112, 186;
}

pre {
padding: 10px 20px !important;
code {
padding: 2px 4px !important;
background-color: #f5f7f9 !important;
border: none !important;
box-shadow: none !important;
border-radius: 0.4rem !important;
border-radius: 0.2rem !important;
}

code {
padding: 2px 4px !important;
pre, .highlight {
padding: 0px !important;
background-color: #f5f7f9 !important;
border: none !important;
border-radius: 0.4rem !important;
box-shadow: none !important;
border-radius: 0.2rem !important;
}

.highlight {
padding: 12px 20px !important;
}

.highlight .go {
font-style: normal !important;
}

div.deprecated {
Expand Down Expand Up @@ -62,11 +70,7 @@ div.deprecated p {
margin: 0.5rem !important;
}

.highlight .go {
font-style: normal !important;
}

@media not (min-width:960px) {
@media not screen and (min-width:960px) {
#navbar-collapsible {
padding: 0px 15px 15px !important;
}
Expand Down
9 changes: 9 additions & 0 deletions docs/metastore/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
'''
Sphinx configuration file.
'''

import os, sys
sys.path.append(os.path.abspath('_pygments/'))

import metastore


Expand Down Expand Up @@ -53,3 +60,5 @@
}
]
}

pygments_style = 'style.MetastoreStyle'
2 changes: 1 addition & 1 deletion metastore/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
__title__ = 'Metastore'

#: Package version.
__version__ = '1.0.0.dev14'
__version__ = '1.0.0.dev15'

#: Package description.
__description__ = 'Metastore Python SDK. Feature store and data catalog for machine learning.'
Expand Down

0 comments on commit 204cdc4

Please sign in to comment.