Skip to content

Commit

Permalink
std: update supported code styles
Browse files Browse the repository at this point in the history
Updating the code maps to include newer code formats supported by
Confluence Cloud, as well as updating supported values based on
Pygments-listed languages.

Signed-off-by: James Knight <[email protected]>
  • Loading branch information
jdknight committed Aug 9, 2024
1 parent 2c6e30a commit 210f2c3
Showing 1 changed file with 59 additions and 98 deletions.
157 changes: 59 additions & 98 deletions sphinxcontrib/confluencebuilder/std/confluence.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,58 +74,31 @@
# [3]: https://confluence.atlassian.com/confcloud/code-block-macro-724765175.html
# [4]: http://pygments.org/docs/lexers/
# [5]: http://www.sphinx-doc.org/en/stable/markup/code.html
LITERAL2LANG_MAP_V1 = {
LITERAL2LANG_MAP_COMMON = {
# (none)
'none': 'none',
'raw': 'none',
'text': 'none',
# ActionScript
'actionscript3': 'actionscript3',
'as3': 'actionscript3',
# AppleScript (Confluence >=6.0)
'applescript': 'applescript',
# Bash
'bash': 'bash',
'ksh': 'bash',
'sh': 'bash',
'shell': 'bash',
'zsh': 'bash',
# C#
'c#': 'csharp',
'csharp': 'csharp',
# C++
'c': 'cpp',
'c++': 'cpp',
'cpp': 'cpp',
# ColdFusion
'cfc': 'coldfusion',
'coldfusion': 'coldfusion',
# CSS
'css': 'css',
# Delphi
'delphi': 'delphi',
'pas': 'delphi',
'pascal': 'delphi',
'objectpascal': 'delphi',
# Diff
'diff': 'diff',
'udiff': 'diff',
# Erlang
'erlang': 'erlang',
# Groovy
'groovy': 'groovy',
# HTML and XML
'html': 'html/xml',
'html/xml': 'html/xml',
'xml': 'html/xml',
'xslt': 'html/xml',
# Java
'java': 'java',
# Java FX
'javafx': 'javafx',
# JavaScript
'javascript': 'javascript',
'js': 'javascript',
# Plain Text
'none': 'none',
'raw': 'none',
'text': 'none',
# Perl (Confluence <=5.10)
'perl': 'perl',
'pl': 'perl',
Expand All @@ -139,12 +112,15 @@
'powershell': 'powershell',
'ps1': 'powershell',
'psm1': 'powershell',
'pwsh': 'powershell',
# Python
'bazel': 'python',
'py': 'python',
'py3': 'python',
'python': 'python',
'python3': 'python',
'sage': 'python',
'starlark': 'python',
# Ruby
'duby': 'ruby',
'rb': 'ruby',
Expand All @@ -153,13 +129,47 @@
'sass': 'sass',
# Scala
'scala': 'scala',
# Shell
'bash': 'bash',
'ksh': 'bash',
'openrc': 'bash',
'sh': 'bash',
'shell': 'bash',
'zsh': 'bash',
# SQL
'sql': 'sql',
# Visual Basic
'vb': 'vb',
'vbscript': 'vb',
'visualbasic': 'vb',
# YAML (Confluence Server >=6.7)
'yaml': 'yaml',
}

LITERAL2LANG_MAP_V1 = {
**LITERAL2LANG_MAP_COMMON,
# C#
'c#': 'csharp',
'csharp': 'csharp',
# C
'c': 'cpp',
# CSS
'css': 'css',
# Delphi
'delphi': 'delphi',
'pas': 'delphi',
'pascal': 'delphi',
'objectpascal': 'delphi',
# Erlang
'erlang': 'erlang',
# HTML and XML
'html': 'html/xml',
'html/xml': 'html/xml',
'xml': 'html/xml',
'xslt': 'html/xml',
# JavaScript
'javascript': 'javascript',
'js': 'javascript',
# (special)
# Sphinx's default highlight language is based off a superset of 'python'.
# To follow Sphinx's method of highlighting, use Confluence's 'python'
Expand All @@ -170,29 +180,19 @@
}

LITERAL2LANG_MAP_V2 = {
# (none)
'none': 'none',
'raw': 'none',
**LITERAL2LANG_MAP_COMMON,
# ABAP
'abap': 'abap',
# ActionScript
'actionscript3': 'actionscript3',
'as3': 'actionscript3',
# Ada
'ada': 'ada',
'ada2005': 'ada',
'ada95': 'ada',
# AppleScript
'applescript': 'applescript',
# Arduino
'arduino': 'arduino',
# Autoit
'autoit': 'autoit',
# C
'c': 'c',
# C++
'c++': 'cpp',
'cpp': 'cpp',
# C#
'c#': 'c#',
'csharp': 'c#',
Expand All @@ -203,9 +203,6 @@
'coffee': 'coffeescript',
'coffee-script': 'coffeescript',
'coffeescript': 'coffeescript',
# ColdFusion
'cfc': 'coldfusion',
'coldfusion': 'coldfusion',
# CSS
'css': 'css',
# CUDA
Expand All @@ -215,9 +212,9 @@
'd': 'd',
# Dart
'dart': 'dart',
# Diff
'diff': 'diff',
'udiff': 'diff',
# Dockerfile
'docker': 'docker',
'dockerfile': 'docker',
# Elixir
'elixir': 'elixir',
'ex': 'elixir',
Expand All @@ -237,21 +234,19 @@
'golang': 'go',
# GraphQL
'graphql': 'graphql',
# Groovy
'groovy': 'groovy',
# Haskell
'haskell': 'haskell',
'hs': 'haskell',
# Haxe
'haxe': 'haxe',
'hx': 'haxe',
'hxsl': 'haxe',
# HCL
'hcl': 'hcl',
'terraform': 'hcl',
'tf': 'hcl',
# HTML and XML
'html': 'html',
# Java
'java': 'java',
# Java FX
'javafx': 'javafx',
# JavaScript
'javascript': 'js',
'js': 'js',
Expand All @@ -276,6 +271,8 @@
'nb': 'mathematica',
# MATLAB
'matlab': 'matlab',
# NGINX
'nginx': 'nginx',
# Objective-C
'obj-c': 'objective-c',
'objc': 'objective-c',
Expand All @@ -295,31 +292,13 @@
'pas': 'pas',
'pascal': 'pas',
'objectpascal': 'pas',
# Perl
'perl': 'perl',
'pl': 'perl',
# PHP
'php': 'php',
'php3': 'php',
'php4': 'php',
'php5': 'php',
# Plain Text
'text': 'text',
# PowerShell
'posh': 'powershell',
'powershell': 'powershell',
'ps1': 'powershell',
'psm1': 'powershell',
# Prolog
'prolog': 'prolog',
# Protocol Buffers
'proto': 'protobuf',
'protobuf': 'protobuf',
# Puppet
'puppet': 'puppet',
# Python
'py': 'py',
'py3': 'py',
'python': 'py',
'python3': 'py',
'sage': 'py',
# QML
'qbs': 'qbs',
'qml': 'qbs',
Expand All @@ -332,35 +311,19 @@
'rest': 'restructuredtext',
'restructuredtext': 'restructuredtext',
'rst': 'restructuredtext',
# Ruby
'duby': 'ruby',
'rb': 'ruby',
'ruby': 'ruby',
# Rust
'rs': 'rust',
'rust': 'rust',
# Sass
'sass': 'sass',
# Scala
'scala': 'scala',
# Scheme
'scm': 'scheme',
'scheme': 'scheme',
# Shell
'bash': 'bash',
'ksh': 'bash',
'sh': 'bash',
'shell': 'bash',
'zsh': 'bash',
# Smalltalk
'smalltalk': 'smalltalk',
'squeak': 'smalltalk',
'st': 'smalltalk',
# SplunkSPL
'spl': 'splunk-spl',
'splunkspl': 'splunk-spl',
# SQL
'sql': 'sql',
# StandardML
'sml': 'standardml',
'standardml': 'standardml',
Expand Down Expand Up @@ -390,10 +353,6 @@
'verilog': 'verilog',
# VHDL
'vhdl': 'vhdl',
# Visual Basic
'vb': 'vb',
'vbscript': 'vb',
'visualbasic': 'vb',
# XML
'xml': 'xml',
'xslt': 'xml',
Expand All @@ -403,8 +362,6 @@
'xqm': 'xquery',
'xquery': 'xquery',
'xqy': 'xquery',
# YAML
'yaml': 'yaml',
# (special)
# Sphinx's default highlight language is based off a superset of 'python'.
# To follow Sphinx's method of highlighting, use Confluence's 'python'
Expand Down Expand Up @@ -442,6 +399,10 @@
'swig': 'cpp',
'vala': 'cpp',
'vapi': 'cpp',
# YAML-like languages
'salt': 'yaml',
'sls': 'yaml',
'yaml+jinja': 'yaml',
}

LITERAL2LANG_FBMAP_V1 = {
Expand Down

0 comments on commit 210f2c3

Please sign in to comment.