diff --git a/Deloitte.md b/Deloitte.md index ef81778..8aaeecf 100644 --- a/Deloitte.md +++ b/Deloitte.md @@ -106,8 +106,12 @@ style: | position: relative; z-index: 1; } + + /* Book syntax highlighting */ + @import url('book-highlight.css'); --- + @@ -129,7 +133,7 @@ style: | - **We make the Book, next-generation language for AI** - You no longer need ML Department to create your own personal AI apps -```markdown +```book # ✨ Email to customer - PERSONA George, experienced AI consultant @@ -147,6 +151,7 @@ style: | ``` --- + # The Benefits for you - Faster, cost-effective solution ✅ diff --git a/book-highlight.css b/book-highlight.css new file mode 100644 index 0000000..64dc796 --- /dev/null +++ b/book-highlight.css @@ -0,0 +1,73 @@ +/* Book Language Syntax Highlighting for Marp */ + +.hljs-keyword { + color: #9932cc; + font-weight: bold; +} + +.hljs-variable { + color: #d63384; + font-weight: bold; +} + +.hljs-section { + color: #0066cc; + font-weight: bold; +} + +.hljs-strong { + font-weight: bold; +} + +.hljs-emphasis { + font-style: italic; +} + +.hljs-code { + color: #CE9178; +} + +.hljs-link { + color: #569CD6; + text-decoration: underline; +} + +.hljs-bullet, .hljs-number { + color: #DCDCAA; +} + +.hljs-quote { + color: #608B4E; + font-style: italic; +} + +.hljs-arrow { + color: #D7BA7D; + font-weight: bold; +} + +.hljs-comment { + color: #888; + font-style: italic; +} + +.hljs-string { + color: #008000; +} + +.hljs-built_in { + color: #0066cc; +} + +.hljs-meta { + color: #1e90ff; + font-weight: bold; +} + +/* Style the code block container for 'book' language */ +pre code.language-book { + background-color: #f8f9fa; + border-left: 4px solid #4a90e2; + border-radius: 3px; + padding: 1em; +} diff --git a/book.js b/book.js new file mode 100644 index 0000000..7d96070 --- /dev/null +++ b/book.js @@ -0,0 +1,63 @@ +// Define custom 'book' language for highlight.js +(function() { + function bookLanguage() { + return { + name: 'book', + aliases: ['promptbook', 'ptbk'], + case_insensitive: true, + keywords: { + keyword: 'PERSONA KNOWLEDGE', + built_in: 'Write Generate Create Describe', + }, + contains: [ + // Section headers + { + className: 'section', + begin: '^#+\\s', + end: '$', + relevance: 10 + }, + // Comments + { + className: 'comment', + begin: '//|#', + end: '$', + contains: [{ + begin: /\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/ + }] + }, + // Prompt blocks with > + { + className: 'string', + begin: '^>', + end: '$', + relevance: 0 + }, + // Variables with {} + { + className: 'variable', + begin: '\\{', + end: '\\}', + relevance: 0 + }, + // Arrows -> + { + className: 'meta', + begin: '->', + end: '$', + relevance: 10 + } + ] + }; + } + + // Register the language with highlight.js when loaded in the browser + if (typeof window !== 'undefined' && window.hljs) { + window.hljs.registerLanguage('book', bookLanguage); + } + + // Export for CommonJS environments (Node.js) + if (typeof module !== 'undefined' && module.exports) { + module.exports = bookLanguage; + } +})(); diff --git a/marp.config.js b/marp.config.js new file mode 100644 index 0000000..cd4a9ab --- /dev/null +++ b/marp.config.js @@ -0,0 +1,28 @@ +module.exports = { + // Enable HTML in Markdown + htmlAsArray: true, + + // Custom highlight.js configuration + highlightjs: { + // Register custom languages + registerLanguages: { + book: { + // Reference the book.js language definition + // This will be loaded from your custom script already included in the presentation + require: './book.js', + // Or you could use an inline definition if needed + // alias: ['promptbook', 'ptbk'] + } + }, + // This will enable auto-loading of languages + autoLanguage: true + }, + + // Other Marp configuration options + math: true, + markdown: { + breaks: true + }, + allowLocalFiles: true, + themeSet: './themes' +}; diff --git a/syntaxes/TODO.txt b/syntaxes/TODO.txt new file mode 100644 index 0000000..47533b1 --- /dev/null +++ b/syntaxes/TODO.txt @@ -0,0 +1 @@ +TODO: Generate book.tmLanguage.json dynamically alongside documentation \ No newline at end of file diff --git a/syntaxes/book.tmLanguage.json b/syntaxes/book.tmLanguage.json new file mode 100644 index 0000000..4394771 --- /dev/null +++ b/syntaxes/book.tmLanguage.json @@ -0,0 +1,289 @@ +{ + "name": "Book Markdown", + "scopeName": "text.book", + "fileTypes": ["book", "book.md", "ptbk", "ptbk.md"], + "patterns": [ + { + "include": "#blocks" + } + ], + "repository": { + "blocks": { + "patterns": [ + { + "include": "#headers" + }, + { + "include": "#blockquotes" + }, + { + "include": "#codeblocks" + }, + { + "include": "#tables" + }, + { + "include": "#inline" + }, + { + "include": "#lists" + }, + { + "include": "#comments" + }, + { + "include": "#commands" + }, + { + "include": "#mermaid" + } + ] + }, + "headers": { + "patterns": [ + { + "name": "heading.1.book", + "match": "^(#{1})\\s+(.*)$", + "captures": { + "1": { + "name": "punctuation.definition.heading.book" + }, + "2": { + "name": "entity.name.section.book" + } + } + }, + { + "name": "heading.2.book", + "match": "^(#{2})\\s+(.*)$", + "captures": { + "1": { + "name": "punctuation.definition.heading.book" + }, + "2": { + "name": "entity.name.section.book" + } + } + } + ] + }, + "inline": { + "patterns": [ + { + "name": "markup.bold.book", + "match": "\\*\\*([^\\*]+)\\*\\*", + "captures": { + "1": { + "name": "markup.bold.book" + } + } + }, + { + "name": "markup.italic.book", + "match": "\\*([^\\*]+)\\*", + "captures": { + "1": { + "name": "markup.italic.book" + } + } + }, + { + "name": "markup.inline.raw.string.book", + "match": "`([^`]+)`", + "captures": { + "1": { + "name": "markup.inline.raw.string.book" + } + } + }, + { + "name": "markup.underline.link.book", + "match": "\\[([^\\]]+)\\]\\(([^\\)]+)\\)", + "captures": { + "1": { + "name": "string.other.link.title.book" + }, + "2": { + "name": "markup.underline.link.book" + } + } + }, + { + "name": "variable.parameter.book", + "match": "\\{([^\\}]+)\\}", + "captures": { + "1": { + "name": "variable.parameter.book" + } + } + } + ] + }, + "lists": { + "patterns": [ + { + "name": "markup.list.unnumbered.book", + "match": "^\\s*([-*+])\\s+(.*)$", + "captures": { + "1": { + "name": "punctuation.definition.list.book" + }, + "2": { + "name": "markup.list.item.book" + } + } + }, + { + "name": "markup.list.numbered.book", + "match": "^\\s*(\\d+[.)])\\s+(.*)$", + "captures": { + "1": { + "name": "punctuation.definition.list.book" + }, + "2": { + "name": "markup.list.item.book" + } + } + } + ] + }, + "blockquotes": { + "name": "markup.quote.book", + "begin": "^\\s*>\\s+", + "end": "$", + "patterns": [ + { + "include": "#inline" + } + ] + }, + "codeblocks": { + "name": "markup.fenced_code.block.book", + "begin": "^\\s*(`{3,}|~{3,}).*$", + "end": "^\\s*\\1\\s*$", + "patterns": [ + { + "include": "source.any" + } + ] + }, + "tables": { + "patterns": [ + { + "name": "markup.table.book", + "match": "^\\|(.+)\\|$", + "captures": { + "1": { + "patterns": [ + { + "match": "[^|]+", + "name": "markup.table.cell.book" + } + ] + } + } + }, + { + "name": "markup.table.delimiter.book", + "match": "^\\|\\s*([-:]+[-| :]*?)\\s*\\|$" + } + ] + }, + "comments": { + "patterns": [ + { + "name": "comment.block.book", + "begin": "", + "patterns": [ + { + "include": "#inline" + } + ] + } + ] + }, + "commands": { + "patterns": [ + { + "name": "keyword.command.section.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?SECTION" + }, + { + "name": "keyword.command.expect.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?EXPECT" + }, + { + "name": "keyword.command.format.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?FORMAT" + }, + { + "name": "keyword.command.joker.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?JOKER" + }, + { + "name": "keyword.command.model.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?MODEL" + }, + { + "name": "keyword.command.parameter.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?PARAMETER" + }, + { + "name": "keyword.command.postprocess.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?POSTPROCESS" + }, + { + "name": "keyword.command.book_version.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?BOOK_VERSION" + }, + { + "name": "keyword.command.formfactor.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?FORMFACTOR" + }, + { + "name": "keyword.command.url.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?URL" + }, + { + "name": "keyword.command.knowledge.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?KNOWLEDGE" + }, + { + "name": "keyword.command.action.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?ACTION" + }, + { + "name": "keyword.command.instrument.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?INSTRUMENT" + }, + { + "name": "keyword.command.persona.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?PERSONA" + }, + { + "name": "keyword.command.foreach.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?FOREACH" + }, + { + "name": "keyword.command.boilerplate.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?BOILERPLATE" + }, + { + "name": "keyword.command.example.book", + "match": "^(\\s*([-*+]|(\\d+[.)]))\\s*)?(EXAMPLE|SAMPLE)" + } + ] + }, + "mermaid": { + "name": "markup.mermaid.book", + "begin": "^\\s*```mermaid\\s*$", + "end": "^\\s*```\\s*$", + "patterns": [ + { + "include": "source.mermaid" + } + ] + } + } +} \ No newline at end of file diff --git a/themes/book-color-theme.json b/themes/book-color-theme.json new file mode 100644 index 0000000..76c5ea4 --- /dev/null +++ b/themes/book-color-theme.json @@ -0,0 +1,52 @@ +{ + "name": "Book Theme", + "tokenColors": [ + { + "scope": "keyword.command.section.book, keyword.command.expect.book, keyword.command.format.book, keyword.command.joker.book, keyword.command.model.book, keyword.command.parameter.book, keyword.command.postprocess.book, keyword.command.book_version.book, keyword.command.formfactor.book, keyword.command.url.book, keyword.command.knowledge.book, keyword.command.action.book, keyword.command.instrument.book, keyword.command.persona.book, keyword.command.foreach.book, keyword.command.boilerplate.book, keyword.command.example.book", + "settings": { + "foreground": "#569CD6", + "fontStyle": "bold" + } + }, + { + "scope": "variable.parameter.book", + "settings": { + "foreground": "#9CDCFE", + "fontStyle": "italic" + } + }, + { + "scope": "markup.bold.book", + "settings": { + "foreground": "#D4D4D4", + "fontStyle": "bold" + } + }, + { + "scope": "markup.italic.book", + "settings": { + "fontStyle": "italic" + } + }, + { + "scope": "heading.1.book, heading.2.book", + "settings": { + "foreground": "#4EC9B0", + "fontStyle": "bold" + } + }, + { + "scope": "markup.inline.raw.string.book", + "settings": { + "foreground": "#CE9178" + } + }, + { + "scope": "markup.underline.link.book", + "settings": { + "foreground": "#569CD6", + "fontStyle": "underline" + } + } + ] +}