├── .bintray.json ├── .gitignore ├── .latexmkrc ├── .travis.yml ├── BytecodeCompilation ├── BytecodeCompilation.pillar └── figures │ ├── BlockScopes.pdf │ ├── BytecodeCompilation.graffle │ ├── CompiledCode.pdf │ ├── MethodScopes.pdf │ └── VariableLookup.pdf ├── KernelConstruction ├── KernelConstruction.pillar └── figures │ ├── MicroKernel.graffle │ └── MicroKernel.pdf ├── Makefile ├── README.md ├── StackManagement ├── StackManagement.pillar └── figures │ ├── ArrayStack.pdf │ ├── ContextStack.graffle │ ├── InitializedSF1.pdf │ ├── InitializedSF2.pdf │ ├── NewStackInterpreterExampleAddto.graffle │ ├── NewStackInterpreterExampleAddto.pdf │ ├── NewStackInterpreterExplanation.graffle │ ├── NewStackInterpreterExplanation.pdf │ ├── OuterContextChain.pdf │ ├── StackPageStack.pdf │ ├── WrappedFrame.pdf │ ├── closure.pdf │ ├── closureContext.pdf │ ├── context1.pdf │ ├── context2.pdf │ ├── contextInterpretation1-v2.pdf │ ├── contextInterpretation1.pdf │ ├── contextInterpretation2.pdf │ ├── linkedListStack.pdf │ ├── notWrappedFrame.pdf │ ├── stack1.pdf │ ├── stack2.pdf │ ├── stackRepresentation2.pdf │ ├── stackpageEx1.graffle │ ├── stackpageEx1.pdf │ ├── stackpageEx2.pdf │ ├── tempAccess1.pdf │ ├── tempAccess2.pdf │ ├── tempVector1.pdf │ └── tempVectorTempAccess.pdf ├── book.pillar ├── figures ├── CreativeCommons-BY-SA.pdf ├── CreativeCommons-BY-SA.png └── CreativeCommons-BY-SA.svg ├── pillar.conf └── support ├── figures └── .keep ├── html ├── css │ ├── bootstrap-theme.min.css │ ├── bootstrap.min.css │ ├── highlight-commands.css │ └── square-braket-associates.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ └── glyphicons-halflings-regular.woff ├── highlightjs │ ├── LICENSE │ ├── README.md │ ├── README.ru.md │ ├── classref.txt │ ├── highlight.pack.js │ └── styles │ │ ├── arta.css │ │ ├── ascetic.css │ │ ├── brown_paper.css │ │ ├── brown_papersq.png │ │ ├── dark.css │ │ ├── default.css │ │ ├── docco.css │ │ ├── far.css │ │ ├── foundation.css │ │ ├── github.css │ │ ├── googlecode.css │ │ ├── idea.css │ │ ├── ir_black.css │ │ ├── magula.css │ │ ├── mono-blue.css │ │ ├── monokai.css │ │ ├── monokai_sublime.css │ │ ├── obsidian.css │ │ ├── pojoaque.css │ │ ├── pojoaque.jpg │ │ ├── railscasts.css │ │ ├── rainbow.css │ │ ├── school_book.css │ │ ├── school_book.png │ │ ├── solarized_dark.css │ │ ├── solarized_light.css │ │ ├── sunburst.css │ │ ├── tomorrow-night-blue.css │ │ ├── tomorrow-night-bright.css │ │ ├── tomorrow-night-eighties.css │ │ ├── tomorrow-night.css │ │ ├── tomorrow.css │ │ ├── vs.css │ │ ├── xcode.css │ │ └── zenburn.css └── js │ ├── annotated-paragraphs.js │ ├── bootstrap.min.js │ └── highlight-commands.js ├── latex ├── common.tex ├── lsthttp.sty ├── lstsmalltalk.sty ├── overcolored.sty ├── sbabook │ ├── .gitignore │ ├── .gitrepo │ ├── .latexmkrc │ ├── .travis.yml │ ├── CreativeCommons-BY-SA.pdf │ ├── README.markdown │ ├── TODO.markdown │ ├── gitinfo2.sh │ ├── lstsmalltalk.sty │ ├── pharo-titlepage.sty │ ├── sba-logo.pdf │ ├── sbabook.cls │ ├── sbabook.spiral.tex │ └── sbabook.tex └── spiral.preamble.tex ├── makefiles ├── epub.mk ├── help.mk ├── html.mk ├── pdf.mk ├── pdf.sub.mk └── prepare.mk ├── scripts └── moveFilesToIbook.sh └── templates ├── chapter.latex.mustache ├── contents.opf.mustache ├── html.mustache ├── main.latex.mustache ├── nav.html.mustache ├── nav.ncx.mustache ├── no-sectioning.latex.mustache ├── title_page.html.mustache └── xhtml.mustache /.bintray.json: -------------------------------------------------------------------------------- 1 | { 2 | "package": { 3 | "name": "booklet-exploringVM", 4 | "repo": "wip", 5 | "subject": "squarebracketassociates", 6 | "desc": "A booklet on stack management for VM", 7 | "licenses": ["MIT"], 8 | "website_url": "https://github.com/SquareBracketAssociates/ExploringVMs", 9 | "issue_tracker_url": "https://github.com/SquareBracketAssociates/ExploringVMs/issues", 10 | "vcs_url": "https://github.com/SquareBracketAssociates/ExploringVMs.git", 11 | "labels": ["work-in-progress"] 12 | }, 13 | 14 | "version": { 15 | "name": "latest", 16 | "desc": "Latest successful build" 17 | }, 18 | 19 | "files": [ 20 | { 21 | "includePattern": "build/(book).spiral.pdf", 22 | "uploadPattern": "ExploringVMs-wip.pdf", 23 | "matrixParams": { "override": 1 } 24 | } 25 | ], 26 | "publish": true 27 | } 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /Pharo.* 2 | /play-cache 3 | /book-result 4 | /build 5 | /mustache 6 | /pharo 7 | /pharo-ui 8 | /pharo-vm 9 | /pillar 10 | /pillarPostExport.sh 11 | /package-cache 12 | .DS_Store 13 | PharoDebug.log 14 | .auctex/ 15 | -------------------------------------------------------------------------------- /.latexmkrc: -------------------------------------------------------------------------------- 1 | # -*- mode: perl; -*- 2 | $pdflatex = 'lualatex --file-line-error --interaction=nonstopmode --halt-on-error %O %S'; 3 | $pdf_mode = 1; 4 | @default_files = ( 'book' ); 5 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | services: 3 | - docker 4 | 5 | before_install: 6 | - docker pull dpollet/texlive:pillar 7 | 8 | script: 9 | - docker run --tty --rm --volume $PWD:/work dpollet/texlive:pillar make spiralbook 10 | 11 | deploy: 12 | - provider: bintray 13 | file: .bintray.json 14 | on: 15 | repo: SquareBracketAssociates/ExploringVMs 16 | skip_cleanup: true 17 | user: ducasse 18 | key: 19 | secure: NAu6xu6Cpn0UrCahtMPohCI7Dq8NcFKGLrIV4irnYiUFBMvF0dgAYYnLxvH3e3QYZCPVjRYlJp1SrqNK+RSo0oUTtqQps4DFXwWcQat90oTggVEzlkySnL9RA4uDGgnIdawGq094Qc90Vlncp+qGM7umdJsbWMCs4nCC3khPBpjjZr6p8v5r3OflMBmfZc7rSeLXMt/ovBMYoAT0Xc+LJXnUxpwuRuYnub6/3nHRgI7XULKO38c/I75tjTkNK1BDTOANLJz98gdX74lwpCr5PSGmPQvig/AvKbi6msGjNY0F47G93a2HMi5PsMDKrBw0z7vtvG1iKdslf5/qqVxGEYx+1x4LRuS9dqkNQiy8tqWOsceNbP3V4UgSkkQa6obG/ek1xUfc9tUS6US9ntqfNreUWLSwovi55g1zdzl2mFYV4zFh8ry12hXyKo5c+M5IHNI45xclNyJYWNknXa93BETxvX+GClRzYZW1NUBR66gDqmgZCMjXcTW9ejo3iI31xW70N/K1e4hblNlK8uFEbuCekGBudnm1JGjRaPsmk1JpAhE+7Jkq5MsCiyousmo1r2q3FuqhEhnRerrPYt5HzK4i5mSDd8wgWuYU6QATJiU6CVPjFJDaUZutxQnnHkTkC3U0WZj8uK7mz+Z1MI7OWPl25sPcEVafQSSlt5SzU3I= 20 | -------------------------------------------------------------------------------- /BytecodeCompilation/BytecodeCompilation.pillar: -------------------------------------------------------------------------------- 1 | [[[eval=true 2 | Gofer it 3 | smalltalkhubUser: 'ClementBera' project: '3DaysVM'; 4 | version: 'ConfigurationOf3DaysVM-ClementBEra.3'; 5 | load. 6 | (Smalltalk at: #ConfigurationOf3DaysVM) loadBleedingEdge. 7 | Smalltalk snapshot: true andQuit: false. 8 | ]]] 9 | 10 | !! Overview of the Bytecode Compiler 11 | 12 | A Bytecode Compiler is a tool that converts the source code of a method or a closure to a representation executable by the virtual machine. 13 | 14 | In this part of the book, the reader has to implement 3 successives bytecode compilers for a restrictive Smalltalk (As shown in the following subsection, it is almost a complete Smalltalk System). To proceed to the next sections, the reader has to implement at least the 2 first compilers. Although the last compiler adds interesting concepts, its implementation is optional. 15 | 16 | !!!! Outline 17 | 18 | - The first compiler can only compile methods and is built over 3 sections (sections *@SimpleCompil*, *@VarCompil* and *@MethodCompil*). 19 | - The second one has support for closures, as they were implemented for the ''context'' interpreter in the previous part of the book. 20 | - The last and optional compiler introduces inlined compilation of control flow operations. 21 | 22 | !!! Overall compiler overview 23 | 24 | what a compiler does blabla Source code -> AST -> Bytecode / compiled code 25 | 26 | !!! Restrictive Smalltalk 27 | 28 | The language we will work on from this part of the book to the end of the book is a simple object language. Everything is an object as in Smalltalk or Ruby. Every method call is a virtual call (no static call). In the example we will use a dynamically and strongly typed language, but the logic could also apply to a statically and strongly typed language. The language will use classes with single inheritance, though it is possible to add multiple inheritance if the read is interested. 29 | 30 | Smalltalk was taken as a direct inspiration for this language. One can see the language as a restrictive Smalltalk or Ruby. It differs from languages like python because it does not support by default static functions such as ==len== and there won't be any primitive types. I guess you can add those features if you want to once you've finished the basic virtual machine. 31 | 32 | If you are familiar with Smalltalk, the language built is a Smalltalk with the specific constraints: 33 | - No cascade and no runtime array are allowed 34 | - Numbered primitives are available but not named primitives 35 | - There are no Class Variable nor Shared Pool nor Pool Dictionnaries, by default those variables are globals. 36 | 37 | !!! Abstract Syntax Tree proposed 38 | 39 | Simple and clean, explain cleaned 40 | 41 | !!! CompiledCode format 42 | 43 | We call ==CompiledCode== the class which instances hold code executable by the virtual machine. The virtual machine built will execute the compiled code using a bytecode interpreter, very similar to the closure context interpreter built in the previous part of the book. 44 | 45 | ==CompiledCode== instances can represent the executable code of a method or a closure. An example of an instance of ==CompiledCode== is shown on figure *@CompiledCode*, it has 5 fields: 46 | - ""numTemps"": holds a Smi representing the number of temporary variables, including the arguments (an argument is considered as a specific kind of temporary variable). 47 | - ""numArgs"": holds a Smi representing the number of arguments. 48 | - ""maxStackSize"": holds a Smi representing the maximum size the stack of the function activation need in the worst case. 49 | - ""literals"": refers to an array of values, called ''literals''. A literal can be for example a constant accessed from the compiled code. In the next section we will discuss more about literals. 50 | - ""bytecodes"": refes to a byte array holding the bytecodes that the virtual machine executes to run the method. 51 | 52 | +Memory representation of CompiledCode.>file://figures/CompiledCode.pdf|width=75|label=CompiledCode+ 53 | 54 | % concrete example of a method here !!!! 55 | 56 | In the ==bytecodes== byte array, each byte means something different. An object, the encoder, is reponsible of the encoding of instructions into bytecodes. Another object, the instruction stream, is responsible of the decoding of the bytecodes into instructions. The encoder usually holds the specification of its encoding. Here is for example the class comment of the ==RSEncoder== you will use: 57 | 58 | [[[eval=true 59 | stream << '[[[' << String cr << RSEncoder comment << String cr << ']]]' 60 | ]]] 61 | 62 | typically write in hexa... 63 | 64 | !! Compilation of simple Methods 65 | @SimpleCompil 66 | 67 | Compilation of examples 1 to 4. 68 | 69 | !!! Compiling Special Variables 70 | 71 | thisContext, self super 72 | 73 | !!! Compiling Returns 74 | 75 | ret 76 | 77 | !!! Compiling Methods and Sequences 78 | 79 | simple things 80 | 81 | !!! Compiling Literals 82 | 83 | lit 84 | 85 | !! Compilation of Variable Accesses 86 | @VarCompil 87 | 88 | Compilation of method 5 to 10. 89 | 90 | !!! Variable Scopes and Lookups 91 | 92 | +Variable scopes.>file://figures/MethodScopes.pdf|width=35|label=MethodScopes+ 93 | 94 | +Variable Lookup.>file://figures/VariableLookup.pdf|width=95|label=VariableLookup+ 95 | 96 | normal variables : building the scopes 97 | Global>>instance>>Temp 98 | 99 | !!! Compiling Assignments 100 | 101 | assign 102 | 103 | !! Full Method Compiler 104 | @MethodCompil 105 | 106 | now compile everything but closures 107 | 108 | up to example 13 109 | 110 | !!! Compiling Message Sends 111 | 112 | regular and super sends 113 | 114 | !!! Compiling Primitives 115 | 116 | primitive numbered or 0 117 | 118 | !! Closure Compiler 119 | 120 | up to example 18 121 | 122 | !!! Compiling Variable Accesses 123 | 124 | +Variable scopes.>file://figures/BlockScopes.pdf|width=50|label=BlockScopes+ 125 | 126 | new scopes for temps 127 | 128 | remote temps 129 | 130 | !!! Compiling a closure 131 | 132 | cl 133 | 134 | !! Static Optimizations of Control Flow Operations 135 | 136 | all examples => up to 24 137 | 138 | cant optimize much blabla 139 | 140 | !!! Inlining Finite Loops 141 | 142 | the example of #to:do: & #to:by:do: 143 | 144 | !!! Inlining Branches 145 | 146 | the example of ifTrue:, ifTrue:ifFalse:, ifFalse:ifTrue:, ifFalse: 147 | 148 | !! What makes a good compiler ? 149 | 150 | blabla 151 | 152 | !!! Handling Compilation error and warnings 153 | 154 | example 155 | 156 | !!! Compilation time 157 | 158 | why these 2 are first ? 159 | 160 | LLVM -=> fast to compile and good error handling, 10% slower in generated code and Apple moved. 161 | 162 | !!! Generated code execution time 163 | 164 | not much we can do in the bytecode compiler though :( 165 | 166 | !!! Generated code execution memory footprint 167 | 168 | often both later are the same as memory access are the more time consuming operation and there are caches. 169 | 170 | !! Discussion 171 | 172 | blabla 173 | 174 | !!! Handling the hidden semantics 175 | 176 | returns and nil blocks. 177 | 178 | !!! Temp vectors 179 | 180 | compiling for StackInterpreter 181 | 182 | no implementation :( in exercise, though you can do it. 183 | 184 | !!! Static versus runtime optimizations 185 | 186 | Aggressive specialization vs memory footprint 187 | 188 | !!! Optimization: Type prediction 189 | 190 | To improve the performance of the execution speed of the compiled code by the virtual machine without adding too many constraints on the system, one can implement a technique invented by Dan Ingalls for early versions of Smalltalk called ""Type prediction"". 191 | 192 | The idea is to identify frequently used selectors that are almost always executed on objects of the same type, compile them differently and optimize their execution in the virtual machine. 193 | 194 | In Pharo, this is done for most of the arithmetic operations: 195 | 196 | [[[eval=true 197 | BytecodeEncoder specialSelectors first: 16 198 | ]]] 199 | 200 | Let's take the example of ==1 \+ 2==. 201 | 202 | Normally, the compiler should compile it as any message send: 203 | [[[ 204 | <16 01> pushLiteral: 1 205 | <16 02> pushLiteral: 2 206 | <24 03 01> send: #+ 207 | ]]] 208 | 209 | If this technique is applied, the compiler will have a list of known selectors that should be compiled differently. Message sends with such selectors will be compiled to specific bytecode instruction instead of the generic message send instructions. Then, the virtual machine execute such specific instruction with specialized code for the selector which is faster. 210 | 211 | On the compiler implemented in this part of the book, many bytecodes are free. Bytes between 39 and 255 does not encode anything. To apply the technique of Type prediction for ==\+==, the compiler and virtual machine implementors change their code as follow: 212 | 213 | - Bytecode set 214 | 215 | The bytecode set is extended to support message sends of specific selectors. On the compiler described in this part of the book, one can use ==100== (==64== in hexadecimal) to encode the message send ==\+==. 216 | 217 | - Compiler 218 | 219 | The compiler has to compile all the message sends with the selector ==\+== to the new bytecode instead of the generic bytecode for message send. 220 | 221 | - Virtual machine 222 | 223 | Assuming we are in an interpreter-based virtual machine, the interpreter will decode the sends of ==\+== differently as it is not the same bytecode. As ==\+== is used mainly for addition between Smis, the execution of ==\+== will first check if the 2 operands are Smis. If it is the case, then it tries to perform the primitive operation. If no overflow happened, then the interpreter directly pops the 2 values from the stack and pushes the result back. As most sends of ==\+== are used on addition of 2 Smis with no overflow, most sends of ==\+== are drastically faster. If an overflow happened or one of the operands was not a Smi, then the interpreter falls back on the execution of the regular message send. Even in this case, as the selector is a constant (==\+==) and not a value to fetch in the literal frame of the method, the send is still faster. 224 | 225 | - Side effects 226 | 227 | The bytecode instruction for ==\+== can be encoded in 1 byte as there is no need to encode the index of the selector in the literal frame nor the number of arguments as it is fixed (1). The literal ==\+== does not need to be put in the literal frame of the compiled code, but instead needs to be directly known by the virtual machine. For a frequently used selector such as ==\+==, this can decrease a lot the memory footprint of the compiled code. 228 | 229 | The method ==\+== in SmallInteger has to have the same behavior as the inlined operation for ==\+== in the interpreter and can't be changed without changing the interpreter. 230 | 231 | !!! Hard Inlining of specific messages 232 | 233 | In some cases, the compiler and virtual machine implementors can decide to inline specific selectors all the time. This is the case in Pharo for example for (identityEqual) == \=\= ==. 234 | 235 | This has implications: 236 | 237 | interrupt points 238 | 239 | no override / message send / lookup 240 | 241 | 242 | -------------------------------------------------------------------------------- /BytecodeCompilation/figures/BlockScopes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/BytecodeCompilation/figures/BlockScopes.pdf -------------------------------------------------------------------------------- /BytecodeCompilation/figures/CompiledCode.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/BytecodeCompilation/figures/CompiledCode.pdf -------------------------------------------------------------------------------- /BytecodeCompilation/figures/MethodScopes.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/BytecodeCompilation/figures/MethodScopes.pdf -------------------------------------------------------------------------------- /BytecodeCompilation/figures/VariableLookup.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/BytecodeCompilation/figures/VariableLookup.pdf -------------------------------------------------------------------------------- /KernelConstruction/KernelConstruction.pillar: -------------------------------------------------------------------------------- 1 | This part of the book deals with Kernel construction for small object languages. 2 | 3 | To start-up, every programming language needs to initialize a minimum set of libraries able to be able to do the basic things needed for a system to run. For example, most programming languages cannot run without the integer arithmetic functions. Start-up implies the loading of those librairies in memory. In the case of a pure object language, like the restricted Smalltalk we are working with, the start-up requires the initialization of a set of objects (including classes and methods) required to run a minimal runtime. 4 | 5 | This part of the book deals with two problems. Firstly, it describes a minimal kernel with around 30 classes required to run the restricted Smalltalk. It is very important for the reader to understand how all the core classes work, because in the next part of the book one will need to debug the kernel code from the virtual machine point of view. However, the virtual machine works with a set of objects, represented in a specific format in memory. So secondly, this part of the book discusses how to bootstrap from the kernel sources into an image, also called a snapshot, which represents a memory dump of the objects corresponding to the kernel bootstrap. To start-up, the virtual machine can just load the snapshot into memory and execute some code precised in the header of the snapshot. 6 | 7 | build the minimum snapshot. 8 | 9 | not done each time for start-up perf. 10 | 11 | Once kernel running, it should be able to load code and not use bootstrap no more. 12 | 13 | Goal: build a snapshot, specificities of smalltalk snapshot. 14 | 15 | preoptimized / optimized kernel from the bootstrap. 16 | 17 | !! Theory: Representing objects in memory 18 | 19 | In this theoretical section, the representation in memory of objects is discussed. The discussion goes from the array of bytes conceptually available in the RAM to the object. 20 | 21 | The memory representation presented is the one you will implement for your language. Once you have understood it, you will be able to rethink it and maybe change your implementation. 22 | 23 | !!! Head first: Mapping an object to raw bytes 24 | 25 | Let's create an object, look at the raw bytes in memory corresponding to the object and understand what they mean. 26 | 27 | We will assume that we are on a 32 bits little endian machine for this example. 28 | 29 | For this purpose, a message send object is created corresponding to ==1 + 2==. 30 | 31 | [[[ 32 | MessageSend new 33 | receiver: 1; 34 | selector: #+; 35 | arguments: #(2); 36 | yourself 37 | ]]] 38 | 39 | Once created, the virtual machine knows that the address of the object is, let's say, ==0x00001464== 40 | 41 | If we look at the bytes around that memory location, we have something like that (32 bits are shown per line): 42 | 43 | [[[ 44 | Memlocation 01 02 03 04 45 | ... 46 | 0x00001448 00 00 00 0C 47 | 0x00001452 4A 10 F5 64 48 | 0x00001456 4A 30 C2 18 49 | 0x00001460 03 4C B3 D0 50 | -0x00001464 00 00 00 03 51 | 0x00001468 4A 3F CC B8 52 | 0x00001472 4A 3E 01 D4 53 | ... 54 | ]]] 55 | 56 | All these bytes correspond to the object. (maybe remove and show more lines.) 57 | 58 | Header + fields => show which bytes are what. 59 | 60 | Our header design: 61 | object size in byte 62 | gc field 63 | class pointer 64 | format (1 byte) hash (1 to 7 bytes) 65 | 66 | => map each byte to what 67 | 68 | field design 69 | field 1 receiver 70 | field 2 selector 71 | field 3 arguments 72 | 73 | => map each byte for what. 74 | 75 | representation of integers ... 76 | 77 | Endianness example => where is the format where is the hash. 78 | 79 | We've seen most objects, iv ones, not what about collection ? 80 | 81 | !!! Variable-sized objects 82 | 83 | bytearray & array 84 | 85 | !!! Discussion: other kind of objects ? 86 | 87 | not in this micro kernel 88 | 89 | as byteArray, multiple byte array can be used 90 | 91 | Weak structures for ex for caching 92 | 93 | More compact structure: iv and variable and bytes, more compact compiled method, more efficient to interpret. 94 | 95 | !! Designing a 30 classes Kernel 96 | 97 | In this section, a 30 classes minimal kernel is proposed. These kernel will be the core of the restricted Smalltalk run. 98 | 99 | !!! Elements needed in the Kernel 100 | 101 | Multiple things are required to have a Smalltalk system running: 102 | - nil, true and false. 103 | - the class Class (which instances are the classes in the system). 104 | - everything needed for a look-up to work: method dictionary, association, symbol, compiledCode, literals (numbers, arrays, ...). 105 | - everything needed to run code: context, closure, compiled code and message for #doesNotUnderstand:. 106 | - a set of objects known by both the VM and the image, in Smalltalk, the special object array 107 | - a global dictionary to access global variables (classes, etc) 108 | 109 | We will add one extra class, OrderedCollection (called sometimes list) which is essential to build anything. In fact, for a widely used language, the minimum kernel bootstrapped needs to be able to load new code. Loading new code implies getting data from a server or a file and a compiler. Such tools are not that easy to build on a small kernel like the one used, so maybe more classes are needed. 110 | 111 | %Discussion on kernel modularity. => our microkernel could be viable on embedded device, even could be too big due to OrderedCollection and Strings and nil. A few classes could be removed / compressed => run with behaviors not classes as cross compiled and no name. Debugging become tough (attach metadata) 112 | 113 | %This kernel was designed to be able to run on 64k so one can build a 16b mem manager easily if he wants to. 114 | 115 | Let's look at the micro kernel proposed in *@MicroKernel*. 116 | 117 | +Micro Kernel.>file://figures/MicroKernel.pdf|width=100|label=MicroKernel+ 118 | 119 | %Maybe we add later HashedCollection and Set if it feels too difficult to explain Dictionary at once. 120 | 121 | %Discussion: 122 | 123 | %--> Is a Dictionary and method dict same class a good idea ? 124 | %Number of memory reads compared to implemenation of literal variables 125 | %memory footprint. 126 | 127 | Core libraries and VM support 128 | => they depend on each other, typically maintained by same crew. Performance lies a lot with kernel libraries. Looking at each bytecode / machine code. Discuss intrinsec in Dart aka optimization primitives 129 | 130 | !! Understanding the 30 classes Kernel 131 | 132 | !!! Object 133 | 134 | = = ~~ DNU ifNil: perform: printing yourself 135 | 136 | !!! Behaviors 137 | 138 | Based on your knowledge from the Object-V-Lisp Kernel, draw a class diagram of Behavior, Object, Class and Metaclass as well as all the classes in between. 139 | 140 | What does all the instance variables of Behavior superclass, methodDict and format mean ? What values they should hold ? 141 | 142 | Explain what the variable thisClass corresponds to in Metaclass. Wa it possible to have such a variable in the Object-V-Lisp Kernel and why ? How many Metaclasses do you have in Pharo comparedd to the number of Classes ? 143 | 144 | (optional) Explain the difference between a Class Variable and the instance variable of a class. 145 | 146 | !!! Boolean 147 | 148 | How would you implement Boolean in an object language ? 149 | 150 | How is ifTrue:ifFalse: implemented conceptually and practically ? If you don’t understand closures very well, explain the implementation of not instead. 151 | 152 | !!! UndefinedObject 153 | 154 | ==UndefinedObject== has a unique instance called ==nil==. This object is used to describe a null state. For example, when an object is created, all its fields reference nil. 155 | 156 | primitive with no answer ? 157 | 158 | Default state. Only ifNil: ifNotNil: not to pollute its API. 159 | 160 | !!! SmalltalkImage 161 | 162 | globals 163 | 164 | specialObjectArray: what are in it and why ? 165 | 166 | !!! Magnitudes 167 | 168 | Numbers 169 | How would you implement numbers using objects ? 170 | 171 | Draw on a paper an inheritance graph which includes Float, SmallInteger, LargeInteger, Object and all the classes needed in-between to have the full graph. 172 | 173 | Which numbers are represented by SmallIntegers ? What does SmallInteger maxVal answer and what does it correspond to ? 174 | 175 | How is implemented the addition between two numbers ? 176 | 177 | (optional) Explain how LargeInteger and Float are implemented 178 | 179 | Character 180 | 181 | !!! Collection 182 | 183 | Draw on a paper an inheritance graph which includes OrderedCollection, Array, Set and Object and all the classes needed in between to have the full graph. 184 | 185 | What is the difference between OrderedCollection, Array and Set ? In which case would you use an OrderedCOllection, an Array or a Set ? If you can’t answer this question, please read the section about Collection in Smalltalk Best Practice Patterns by Kent Beck. 186 | 187 | Explain the implementation of OrderedCollection (what do its instance variables mean, how is implemented add:, at:, addFirst:, size, includes: ). 188 | 189 | Explain the implementation of Array. How is implemented at:, at:put:, size ? 190 | 191 | Explain the implementation of Set, especially add: and includes:. Your explanation should mention hashes. 192 | 193 | What is a Dictionnary ? Explain the implementation of a dictionary. The lookup is done using the implementation details of a dictionary to avoid iterating over all the elements for all the superclasses to find the method to activate. 194 | 195 | !!! Runtime support 196 | 197 | ... Discussed in previous book sections ! 198 | 199 | Onmy Message to discuss slightly 200 | 201 | !! Exporting the Kernel 202 | 203 | generic idea... 204 | 205 | Building the first snapshot. 206 | 207 | Addresses are relative to beginning of snapshot. 208 | 209 | !!! Exporting compiled method 210 | 211 | cross compilation 212 | 213 | !!! Exporting classes 214 | 215 | special object array 216 | 217 | !!! Exporting tables 218 | 219 | Character and symbol table 220 | 221 | !! Rethinking the Memory representation 222 | 223 | In this section we discuss what was good in this memory representation and what was not. To do so, we firstly discuss how one can evaluate if a memory representation is good or not, then we discuss the application on the design used in this part of the book 224 | 225 | !!! What is a good Memory Representation ? 226 | 227 | !!!! Compactness 228 | 229 | The first and most critical point of a good memory representation is the compactness. For a given set of objects that represents the average heap the virtual machine will have to handle, how many bytes does the virtual machine need to represent them all ? The memory footprint has to be as little as possible to have a good virtual machine. 230 | 231 | The compactness involves the memory representation of object headers but also the implementation of the core libraries. 232 | 233 | For example, in the current design, we use the last object's header field to store both the hash and the format of the object. If we had used two fields, the virtual machine would need an extra 4 bytes per object to represent the same set of objects, though that might be convenient as a 32 bits hash would lead to less hash conflicts than 24 bits hash. The header's representation has to be as compact as possible. 234 | 235 | On the other hand, the size of compiled code depends a lot on the size of the bytecodes. Reducing the memory footprint of compiled code may depend more on changing the bytecode set design. In a similar way, Strings are represented in the micro kernel as an array of Characters. They are the array themselves, and they do not hold an instance variable which is an instance of Array, which is already some kind of memory optimizations as it saves a few bytes per String. One can even do better: in english, most strings hold only ASCII characters which can be encoded in a single byte. Hence, one could design another memory representation of Strings in the form of a byte array, holding directly the ASCII code of each character, to encode most strings and save even more space. 236 | 237 | !!!! Fast Access 238 | 239 | The second main evaluation point of a good memory representation for objects is the access speed to the different object features. The idea here is to compute precisely how many instructions the interpreter and the machine code generated by the JIT compiler will need to access specific information about an object. 240 | 241 | Let's take a simple example. In a specific virtual machine, one wants to have for each object to have: 242 | - 22 bits holding the hash of the object 243 | - 1 byte specifying the object format 244 | - 2 bits that the garbage collector uses to mark objects in different states 245 | 246 | As these information can fit in 32 bits, the programmer will fit them in a single 32 bit word not to waste any memory (compactness is the first point of evaluation). Now, how will the programmer design its object header ? 247 | 248 | Here is an example (still big endian ?) 249 | [22 bits hash][8 bits object format][2 bits GC] 250 | 251 | discuss byte access, two byte access, word access etc. 252 | 253 | This design is terrible. Let's estimate the cost of each access: 254 | - hash: 1) read the 32 bits word 2) bitShift 10 255 | - object format: 1) read the 32 bits word 2) bitshift 2 3) bitAnd 1 << 8 - 1 256 | - 2 bits GC: 1) read the bottom byte 2) bitAnd: 3 257 | 258 | Format is frequently accessed in several objects such as array for bounds check. 259 | 260 | Let's look at another design 261 | [8 bits object format][2 bits GC][22 bits hash] 262 | Estimation of the cost per read: 263 | - hash: 1) read the 32 bits word 2) bitAnd 1 << 22 - 1 264 | - object format: 1) read the top byte 265 | - 2 bits gc: 1) read second byte 2) bitshift: 1 << 6 - 1 266 | 267 | Design is way better because faster object format while other instructions are as fast. 268 | 269 | at: and at:put: and size perf difference is huge between those 2 representation, and they are performance critical primitives. 270 | 271 | !!!! Features 272 | 273 | become, becomeForward, dynamically growing objects such as python or Javascript 274 | 275 | !!! How can we improve the current design ? 276 | 277 | very compact object header: class index, only few bits for GC (though moving then requires allocated table). 278 | 279 | core library such as string and symbol (look at pharo) 280 | new memory representation for WordArray, ShortArray etc 281 | more specialized bytecode set (fast interpreter too !) 282 | compiled method header 283 | MethodDictionary -> both perf and memory footprint changed. 284 | OrderedCollection -> space wasted, heuristic between free space and copying 285 | Runtime objects such as context could have the stack inlined as fixed sized, implying new memory format for mixed inst var and variable slots. 286 | -------------------------------------------------------------------------------- /KernelConstruction/figures/MicroKernel.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/KernelConstruction/figures/MicroKernel.pdf -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | MAIN = book 2 | CHAPTERS = \ 3 | StackManagement/StackManagement \ 4 | BytecodeCompilation/BytecodeCompilation \ 5 | KernelConstruction/KernelConstruction 6 | 7 | OUTPUTDIRECTORY = build 8 | LATEXTEMPLATE = support/templates/main.latex.mustache 9 | LATEXCHAPTERTEMPLATE = support/templates/chapter.latex.mustache 10 | HTMLTEMPLATE = support/templates/html.mustache 11 | HTMLCHAPTERTEMPLATE = $(HTMLTEMPLATE) 12 | 13 | .DEFAULT_GOAL = help 14 | .phony: all book chapters 15 | 16 | all: pdf html ## Build everything in all formats 17 | book: pdfbook htmlbook ## Full book only, all formats 18 | chapters: pdfchapters htmlchapters ## Separate chapters, all formats 19 | 20 | include support/makefiles/help.mk 21 | include support/makefiles/prepare.mk 22 | 23 | include support/makefiles/pdf.mk 24 | include support/makefiles/html.mk 25 | include support/makefiles/epub.mk 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Building an object-oriented language Virtual Machine in 72 hours 2 | 3 | [![Build status][badge]][travis] 4 | 5 | This books was designed for developers who knows how to program in object-oriented languages but do not know how to implement an object engine (a virtual machine, an object kernel, a bytecode compiler, ...). It includes several tutorials to teach how to build a simple interpreter based virtual machine for a simple object-oriented language the reader will create. The object-oriented language built is fairly simple. Everything is an object. The language is similar to Smalltalk or Ruby. 6 | 7 | Currently the implementation part (templates and examples) are done in Pharo Smalltalk and C. The book has to be based on a high-level and a low-level language to work well. If you are interested in porting the book to another couple of languages (for example, Javascript as a high-level language and Rust as a low level language), please contact me (contact at bottom of document). 8 | 9 | ## Installation 10 | 11 | - Clone the repository 12 | - Install packages related to latex compilation (TeXlive 2016; have a look at [the `dpollet/texlive:pillar` Docker image][docker] used by [Travis][]) 13 | - Run `make pdfbook` to produce the full book (in `build/book.pdf`) 14 | - You can find a [PDF version of the booklet here ] (https://bintray.com/squarebracketassociates/wip/download_file?file_path=ExploringVMs-wip.pdf) 15 | 16 | If it does not work I can send you a precompiled version if you contact me (contact at bottom of document). There is *currently* no alternatives. 17 | 18 | ## Status 19 | 20 | - *released*: These sections are opened to everyone and the book writers are happy to discuss them. 21 | - *beta*: While not necessarily completely finished, these sections are opened to external beta testers. Please give feedback if you are experimenting with a beta section. The book writers will improve these sections based on beta tester feedbacks and are happy to discuss them. 22 | - *alpha*: Reserved for the book writer(s). External people can read and use these sections, but they are incomplete and the book writers may ignore any questions or requests related to those sections. 23 | 24 | The overall book is in alpha. 25 | 26 | The Part 1 (Managing a call stack) has moved from alpha to beta January 14th. Please report feedback on comments on this section (contact at bottom of document). 27 | 28 | ### Contact 29 | 30 | Clement Bera: 31 | clement.bera *at* inria *dot* fr 32 | 33 | [travis]: https://travis-ci.org/SquareBracketAssociates/ExploringVMs 34 | [badge]: https://travis-ci.org/SquareBracketAssociates/ExploringVMs.svg?branch=master 35 | [docker]: https://hub.docker.com/r/dpollet/texlive/ 36 | -------------------------------------------------------------------------------- /StackManagement/figures/ArrayStack.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/ArrayStack.pdf -------------------------------------------------------------------------------- /StackManagement/figures/InitializedSF1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/InitializedSF1.pdf -------------------------------------------------------------------------------- /StackManagement/figures/InitializedSF2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/InitializedSF2.pdf -------------------------------------------------------------------------------- /StackManagement/figures/NewStackInterpreterExampleAddto.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/NewStackInterpreterExampleAddto.pdf -------------------------------------------------------------------------------- /StackManagement/figures/NewStackInterpreterExplanation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/NewStackInterpreterExplanation.pdf -------------------------------------------------------------------------------- /StackManagement/figures/OuterContextChain.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/OuterContextChain.pdf -------------------------------------------------------------------------------- /StackManagement/figures/StackPageStack.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/StackPageStack.pdf -------------------------------------------------------------------------------- /StackManagement/figures/WrappedFrame.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/WrappedFrame.pdf -------------------------------------------------------------------------------- /StackManagement/figures/closure.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/closure.pdf -------------------------------------------------------------------------------- /StackManagement/figures/closureContext.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/closureContext.pdf -------------------------------------------------------------------------------- /StackManagement/figures/context1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/context1.pdf -------------------------------------------------------------------------------- /StackManagement/figures/context2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/context2.pdf -------------------------------------------------------------------------------- /StackManagement/figures/contextInterpretation1-v2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/contextInterpretation1-v2.pdf -------------------------------------------------------------------------------- /StackManagement/figures/contextInterpretation1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/contextInterpretation1.pdf -------------------------------------------------------------------------------- /StackManagement/figures/contextInterpretation2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/contextInterpretation2.pdf -------------------------------------------------------------------------------- /StackManagement/figures/linkedListStack.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/linkedListStack.pdf -------------------------------------------------------------------------------- /StackManagement/figures/notWrappedFrame.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/notWrappedFrame.pdf -------------------------------------------------------------------------------- /StackManagement/figures/stack1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/stack1.pdf -------------------------------------------------------------------------------- /StackManagement/figures/stack2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/stack2.pdf -------------------------------------------------------------------------------- /StackManagement/figures/stackRepresentation2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/stackRepresentation2.pdf -------------------------------------------------------------------------------- /StackManagement/figures/stackpageEx1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/stackpageEx1.pdf -------------------------------------------------------------------------------- /StackManagement/figures/stackpageEx2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/stackpageEx2.pdf -------------------------------------------------------------------------------- /StackManagement/figures/tempAccess1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/tempAccess1.pdf -------------------------------------------------------------------------------- /StackManagement/figures/tempAccess2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/tempAccess2.pdf -------------------------------------------------------------------------------- /StackManagement/figures/tempVector1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/tempVector1.pdf -------------------------------------------------------------------------------- /StackManagement/figures/tempVectorTempAccess.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/StackManagement/figures/tempVectorTempAccess.pdf -------------------------------------------------------------------------------- /book.pillar: -------------------------------------------------------------------------------- 1 | ! Managing the Call Stack 2 | ${inputFile:StackManagement/StackManagement.pillar}$ 3 | 4 | ! Bytecode Compilation 5 | ${inputFile:BytecodeCompilation/BytecodeCompilation.pillar}$ 6 | 7 | ! Kernel Construction 8 | ${inputFile:KernelConstruction/KernelConstruction.pillar}$ 9 | -------------------------------------------------------------------------------- /figures/CreativeCommons-BY-SA.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/figures/CreativeCommons-BY-SA.pdf -------------------------------------------------------------------------------- /figures/CreativeCommons-BY-SA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/figures/CreativeCommons-BY-SA.png -------------------------------------------------------------------------------- /pillar.conf: -------------------------------------------------------------------------------- 1 | { 2 | "metadata" : { 3 | "title": "Building a simple Object Language Virtual Machine in 72 hours", 4 | "attribution": "Clément Béra", 5 | "series": "Square Bracket tutorials", 6 | "keywords": "dynamic languages, virtual machine, compiler, garbage collector, Pharo, Smalltalk" 7 | }, 8 | "newLine":#unix, 9 | "configurations": { 10 | "LaTeX" : { 11 | "outputType":#'latex:sbabook', 12 | "headingLevelOffset" : 0, 13 | "separateOutputFiles":true 14 | }, 15 | "HTML" : { 16 | "outputType":#html, 17 | "separateOutputFiles":true 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /support/figures/.keep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/support/figures/.keep -------------------------------------------------------------------------------- /support/html/css/bootstrap-theme.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.1.1 (http://getbootstrap.com) 3 | * Copyright 2011-2014 Twitter, Inc. 4 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 5 | */ 6 | 7 | .btn-default,.btn-primary,.btn-success,.btn-info,.btn-warning,.btn-danger{text-shadow:0 -1px 0 rgba(0,0,0,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 1px rgba(0,0,0,.075)}.btn-default:active,.btn-primary:active,.btn-success:active,.btn-info:active,.btn-warning:active,.btn-danger:active,.btn-default.active,.btn-primary.active,.btn-success.active,.btn-info.active,.btn-warning.active,.btn-danger.active{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn:active,.btn.active{background-image:none}.btn-default{background-image:-webkit-linear-gradient(top,#fff 0,#e0e0e0 100%);background-image:linear-gradient(to bottom,#fff 0,#e0e0e0 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ffe0e0e0', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#dbdbdb;text-shadow:0 1px 0 #fff;border-color:#ccc}.btn-default:hover,.btn-default:focus{background-color:#e0e0e0;background-position:0 -15px}.btn-default:active,.btn-default.active{background-color:#e0e0e0;border-color:#dbdbdb}.btn-primary{background-image:-webkit-linear-gradient(top,#428bca 0,#2d6ca2 100%);background-image:linear-gradient(to bottom,#428bca 0,#2d6ca2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff2d6ca2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#2b669a}.btn-primary:hover,.btn-primary:focus{background-color:#2d6ca2;background-position:0 -15px}.btn-primary:active,.btn-primary.active{background-color:#2d6ca2;border-color:#2b669a}.btn-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#419641 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#419641 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff419641', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#3e8f3e}.btn-success:hover,.btn-success:focus{background-color:#419641;background-position:0 -15px}.btn-success:active,.btn-success.active{background-color:#419641;border-color:#3e8f3e}.btn-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#2aabd2 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#2aabd2 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff2aabd2', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#28a4c9}.btn-info:hover,.btn-info:focus{background-color:#2aabd2;background-position:0 -15px}.btn-info:active,.btn-info.active{background-color:#2aabd2;border-color:#28a4c9}.btn-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#eb9316 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#eb9316 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffeb9316', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#e38d13}.btn-warning:hover,.btn-warning:focus{background-color:#eb9316;background-position:0 -15px}.btn-warning:active,.btn-warning.active{background-color:#eb9316;border-color:#e38d13}.btn-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c12e2a 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c12e2a 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc12e2a', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);background-repeat:repeat-x;border-color:#b92c28}.btn-danger:hover,.btn-danger:focus{background-color:#c12e2a;background-position:0 -15px}.btn-danger:active,.btn-danger.active{background-color:#c12e2a;border-color:#b92c28}.thumbnail,.img-thumbnail{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0);background-color:#e8e8e8}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0);background-color:#357ebd}.navbar-default{background-image:-webkit-linear-gradient(top,#fff 0,#f8f8f8 100%);background-image:linear-gradient(to bottom,#fff 0,#f8f8f8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#fff8f8f8', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);border-radius:4px;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.15),0 1px 5px rgba(0,0,0,.075)}.navbar-default .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f3f3f3 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f3f3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff3f3f3', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.075);box-shadow:inset 0 3px 9px rgba(0,0,0,.075)}.navbar-brand,.navbar-nav>li>a{text-shadow:0 1px 0 rgba(255,255,255,.25)}.navbar-inverse{background-image:-webkit-linear-gradient(top,#3c3c3c 0,#222 100%);background-image:linear-gradient(to bottom,#3c3c3c 0,#222 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff3c3c3c', endColorstr='#ff222222', GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .navbar-nav>.active>a{background-image:-webkit-linear-gradient(top,#222 0,#282828 100%);background-image:linear-gradient(to bottom,#222 0,#282828 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222', endColorstr='#ff282828', GradientType=0);-webkit-box-shadow:inset 0 3px 9px rgba(0,0,0,.25);box-shadow:inset 0 3px 9px rgba(0,0,0,.25)}.navbar-inverse .navbar-brand,.navbar-inverse .navbar-nav>li>a{text-shadow:0 -1px 0 rgba(0,0,0,.25)}.navbar-static-top,.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}.alert{text-shadow:0 1px 0 rgba(255,255,255,.2);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.25),0 1px 2px rgba(0,0,0,.05)}.alert-success{background-image:-webkit-linear-gradient(top,#dff0d8 0,#c8e5bc 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#c8e5bc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffc8e5bc', GradientType=0);border-color:#b2dba1}.alert-info{background-image:-webkit-linear-gradient(top,#d9edf7 0,#b9def0 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#b9def0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffb9def0', GradientType=0);border-color:#9acfea}.alert-warning{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#f8efc0 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#f8efc0 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fff8efc0', GradientType=0);border-color:#f5e79e}.alert-danger{background-image:-webkit-linear-gradient(top,#f2dede 0,#e7c3c3 100%);background-image:linear-gradient(to bottom,#f2dede 0,#e7c3c3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffe7c3c3', GradientType=0);border-color:#dca7a7}.progress{background-image:-webkit-linear-gradient(top,#ebebeb 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#ebebeb 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffebebeb', endColorstr='#fff5f5f5', GradientType=0)}.progress-bar{background-image:-webkit-linear-gradient(top,#428bca 0,#3071a9 100%);background-image:linear-gradient(to bottom,#428bca 0,#3071a9 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3071a9', GradientType=0)}.progress-bar-success{background-image:-webkit-linear-gradient(top,#5cb85c 0,#449d44 100%);background-image:linear-gradient(to bottom,#5cb85c 0,#449d44 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5cb85c', endColorstr='#ff449d44', GradientType=0)}.progress-bar-info{background-image:-webkit-linear-gradient(top,#5bc0de 0,#31b0d5 100%);background-image:linear-gradient(to bottom,#5bc0de 0,#31b0d5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de', endColorstr='#ff31b0d5', GradientType=0)}.progress-bar-warning{background-image:-webkit-linear-gradient(top,#f0ad4e 0,#ec971f 100%);background-image:linear-gradient(to bottom,#f0ad4e 0,#ec971f 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff0ad4e', endColorstr='#ffec971f', GradientType=0)}.progress-bar-danger{background-image:-webkit-linear-gradient(top,#d9534f 0,#c9302c 100%);background-image:linear-gradient(to bottom,#d9534f 0,#c9302c 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9534f', endColorstr='#ffc9302c', GradientType=0)}.list-group{border-radius:4px;-webkit-box-shadow:0 1px 2px rgba(0,0,0,.075);box-shadow:0 1px 2px rgba(0,0,0,.075)}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{text-shadow:0 -1px 0 #3071a9;background-image:-webkit-linear-gradient(top,#428bca 0,#3278b3 100%);background-image:linear-gradient(to bottom,#428bca 0,#3278b3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff3278b3', GradientType=0);border-color:#3278b3}.panel{-webkit-box-shadow:0 1px 2px rgba(0,0,0,.05);box-shadow:0 1px 2px rgba(0,0,0,.05)}.panel-default>.panel-heading{background-image:-webkit-linear-gradient(top,#f5f5f5 0,#e8e8e8 100%);background-image:linear-gradient(to bottom,#f5f5f5 0,#e8e8e8 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5', endColorstr='#ffe8e8e8', GradientType=0)}.panel-primary>.panel-heading{background-image:-webkit-linear-gradient(top,#428bca 0,#357ebd 100%);background-image:linear-gradient(to bottom,#428bca 0,#357ebd 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff428bca', endColorstr='#ff357ebd', GradientType=0)}.panel-success>.panel-heading{background-image:-webkit-linear-gradient(top,#dff0d8 0,#d0e9c6 100%);background-image:linear-gradient(to bottom,#dff0d8 0,#d0e9c6 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffdff0d8', endColorstr='#ffd0e9c6', GradientType=0)}.panel-info>.panel-heading{background-image:-webkit-linear-gradient(top,#d9edf7 0,#c4e3f3 100%);background-image:linear-gradient(to bottom,#d9edf7 0,#c4e3f3 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffd9edf7', endColorstr='#ffc4e3f3', GradientType=0)}.panel-warning>.panel-heading{background-image:-webkit-linear-gradient(top,#fcf8e3 0,#faf2cc 100%);background-image:linear-gradient(to bottom,#fcf8e3 0,#faf2cc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffcf8e3', endColorstr='#fffaf2cc', GradientType=0)}.panel-danger>.panel-heading{background-image:-webkit-linear-gradient(top,#f2dede 0,#ebcccc 100%);background-image:linear-gradient(to bottom,#f2dede 0,#ebcccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2dede', endColorstr='#ffebcccc', GradientType=0)}.well{background-image:-webkit-linear-gradient(top,#e8e8e8 0,#f5f5f5 100%);background-image:linear-gradient(to bottom,#e8e8e8 0,#f5f5f5 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe8e8e8', endColorstr='#fff5f5f5', GradientType=0);border-color:#dcdcdc;-webkit-box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 3px rgba(0,0,0,.05),0 1px 0 rgba(255,255,255,.1)} -------------------------------------------------------------------------------- /support/html/css/highlight-commands.css: -------------------------------------------------------------------------------- 1 | pre .shellcommands .prompt { 2 | font-weight: bold; 3 | } 4 | pre .shellcommands .output { 5 | color: #666; 6 | } 7 | -------------------------------------------------------------------------------- /support/html/css/square-braket-associates.css: -------------------------------------------------------------------------------- 1 | h5, .h5 { 2 | font-size: 16px; 3 | } 4 | 5 | .annotated-paragraph { 6 | margin: 20px 0; 7 | padding: 15px 30px 15px 15px; 8 | border-left: 5px solid #eee; 9 | } 10 | 11 | .annotated-paragraph h4 { 12 | margin-top: 0; 13 | } 14 | 15 | .annotated-paragraph p:last-child { 16 | margin-bottom: 0; 17 | } 18 | 19 | .note { 20 | background-color: #f0f7fd; 21 | border-color: #d0e3f0; 22 | } 23 | 24 | .note h4 { 25 | color: #3a87ad; 26 | } 27 | 28 | .todo { 29 | background-color: #dff0d8; 30 | border-color: #d6e9c6; 31 | } 32 | 33 | .todo h4 { 34 | color: #3c763d; 35 | } 36 | 37 | .authorToDo { 38 | background-color: #ff0000; 39 | border: 4px solid black; 40 | } 41 | 42 | .authorToDo h4 { 43 | color: #3c763d; 44 | } -------------------------------------------------------------------------------- /support/html/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/support/html/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /support/html/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/support/html/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /support/html/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/support/html/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /support/html/highlightjs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006, Ivan Sagalaev 2 | All rights reserved. 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of highlight.js nor the names of its contributors 12 | may be used to endorse or promote products derived from this software 13 | without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY 16 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /support/html/highlightjs/README.md: -------------------------------------------------------------------------------- 1 | # Highlight.js 2 | 3 | Highlight.js highlights syntax in code examples on blogs, forums and, 4 | in fact, on any web page. It's very easy to use because it works 5 | automatically: finds blocks of code, detects a language, highlights it. 6 | 7 | Autodetection can be fine tuned when it fails by itself (see "Heuristics"). 8 | 9 | 10 | ## Basic usage 11 | 12 | Link the library and a stylesheet from your page and hook highlighting to 13 | the page load event: 14 | 15 | ```html 16 | 17 | 18 | 19 | ``` 20 | 21 | This will highlight all code on the page marked up as `
 .. 
`. 22 | If you use different markup or need to apply highlighting dynamically, read 23 | "Custom initialization" below. 24 | 25 | - You can download your own customized version of "highlight.pack.js" or 26 | use the hosted one as described on the download page: 27 | 28 | 29 | - Style themes are available in the download package or as hosted files. 30 | To create a custom style for your site see the class reference in the file 31 | [classref.txt][cr] from the downloaded package. 32 | 33 | [cr]: http://github.com/isagalaev/highlight.js/blob/master/classref.txt 34 | 35 | 36 | ## node.js 37 | 38 | Highlight.js can be used under node.js. The package with all supported languages is 39 | installable from NPM: 40 | 41 | npm install highlight.js 42 | 43 | Alternatively, you can build it from the source with only languages you need: 44 | 45 | python3 tools/build.py -tnode lang1 lang2 .. 46 | 47 | Using the library: 48 | 49 | ```javascript 50 | var hljs = require('highlight.js'); 51 | 52 | // If you know the language 53 | hljs.highlight(lang, code).value; 54 | 55 | // Automatic language detection 56 | hljs.highlightAuto(code).value; 57 | ``` 58 | 59 | 60 | ## AMD 61 | 62 | Highlight.js can be used with an AMD loader. You will need to build it from 63 | source in order to do so: 64 | 65 | ```bash 66 | $ python3 tools/build.py -tamd lang1 lang2 .. 67 | ``` 68 | 69 | Which will generate a `build/highlight.pack.js` which will load as an AMD 70 | module with support for the built languages and can be used like so: 71 | 72 | ```javascript 73 | require(["highlight.js/build/highlight.pack"], function(hljs){ 74 | 75 | // If you know the language 76 | hljs.highlight(lang, code).value; 77 | 78 | // Automatic language detection 79 | hljs.highlightAuto(code).value; 80 | }); 81 | ``` 82 | 83 | 84 | ## Tab replacement 85 | 86 | You can replace TAB ('\x09') characters used for indentation in your code 87 | with some fixed number of spaces or with a `` to give them special 88 | styling: 89 | 90 | ```html 91 | 98 | ``` 99 | 100 | ## Custom initialization 101 | 102 | If you use different markup for code blocks you can initialize them manually 103 | with `highlightBlock(code, tabReplace, useBR)` function. It takes a DOM element 104 | containing the code to highlight and optionally a string with which to replace 105 | TAB characters. 106 | 107 | Initialization using, for example, jQuery might look like this: 108 | 109 | ```javascript 110 | $(document).ready(function() { 111 | $('pre code').each(function(i, e) {hljs.highlightBlock(e)}); 112 | }); 113 | ``` 114 | 115 | You can use `highlightBlock` to highlight blocks dynamically inserted into 116 | the page. Just make sure you don't do it twice for already highlighted 117 | blocks. 118 | 119 | If your code container relies on `
` tags instead of line breaks (i.e. if 120 | it's not `
`) pass `true` into the third parameter of `highlightBlock`
121 | to make highlight.js use `
` in the output: 122 | 123 | ```javascript 124 | $('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)}); 125 | ``` 126 | 127 | 128 | ## Heuristics 129 | 130 | Autodetection of a code's language is done using a simple heuristic: 131 | the program tries to highlight a fragment with all available languages and 132 | counts all syntactic structures that it finds along the way. The language 133 | with greatest count wins. 134 | 135 | This means that in short fragments the probability of an error is high 136 | (and it really happens sometimes). In this cases you can set the fragment's 137 | language explicitly by assigning a class to the `` element: 138 | 139 | ```html 140 |
...
141 | ``` 142 | 143 | You can use class names recommended in HTML5: "language-html", 144 | "language-php". Classes also can be assigned to the `
` element.
145 | 
146 | To disable highlighting of a fragment altogether use "no-highlight" class:
147 | 
148 | ```html
149 | 
...
150 | ``` 151 | 152 | 153 | ## Export 154 | 155 | File export.html contains a little program that allows you to paste in a code 156 | snippet and then copy and paste the resulting HTML code generated by the 157 | highlighter. This is useful in situations when you can't use the script itself 158 | on a site. 159 | 160 | 161 | ## Meta 162 | 163 | - Version: 7.5 164 | - URL: http://highlightjs.org/ 165 | 166 | For the license terms see LICENSE files. 167 | For authors and contributors see AUTHORS.en.txt file. 168 | -------------------------------------------------------------------------------- /support/html/highlightjs/README.ru.md: -------------------------------------------------------------------------------- 1 | # Highlight.js 2 | 3 | Highlight.js нужен для подсветки синтаксиса в примерах кода в блогах, 4 | форумах и вообще на любых веб-страницах. Пользоваться им очень просто, 5 | потому что работает он автоматически: сам находит блоки кода, сам 6 | определяет язык, сам подсвечивает. 7 | 8 | Автоопределением языка можно управлять, когда оно не справляется само (см. 9 | дальше "Эвристика"). 10 | 11 | 12 | ## Простое использование 13 | 14 | Подключите библиотеку и стиль на страницу и повесть вызов подсветки на 15 | загрузку страницы: 16 | 17 | ```html 18 | 19 | 20 | 21 | ``` 22 | 23 | Весь код на странице, обрамлённый в теги `
 .. 
` 24 | будет автоматически подсвечен. Если вы используете другие теги или хотите 25 | подсвечивать блоки кода динамически, читайте "Инициализацию вручную" ниже. 26 | 27 | - Вы можете скачать собственную версию "highlight.pack.js" или сослаться 28 | на захостенный файл, как описано на странице загрузки: 29 | 30 | 31 | - Стилевые темы можно найти в загруженном архиве или также использовать 32 | захостенные. Чтобы сделать собственный стиль для своего сайта, вам 33 | будет полезен справочник классов в файле [classref.txt][cr], который тоже 34 | есть в архиве. 35 | 36 | [cr]: http://github.com/isagalaev/highlight.js/blob/master/classref.txt 37 | 38 | 39 | ## node.js 40 | 41 | Highlight.js можно использовать в node.js. Библиотеку со всеми возможными языками можно 42 | установить с NPM: 43 | 44 | npm install highlight.js 45 | 46 | Также её можно собрать из исходников с только теми языками, которые нужны: 47 | 48 | python3 tools/build.py -tnode lang1 lang2 .. 49 | 50 | Использование библиотеки: 51 | 52 | ```javascript 53 | var hljs = require('highlight.js'); 54 | 55 | // Если вы знаете язык 56 | hljs.highlight(lang, code).value; 57 | 58 | // Автоопределение языка 59 | hljs.highlightAuto(code).value; 60 | ``` 61 | 62 | 63 | ## AMD 64 | 65 | Highlight.js можно использовать с загрузчиком AMD-модулей. Для этого его 66 | нужно собрать из исходников следующей командой: 67 | 68 | ```bash 69 | $ python3 tools/build.py -tamd lang1 lang2 .. 70 | ``` 71 | 72 | Она создаст файл `build/highlight.pack.js`, который является загружаемым 73 | AMD-модулем и содержит все выбранные при сборке языки. Используется он так: 74 | 75 | ```javascript 76 | require(["highlight.js/build/highlight.pack"], function(hljs){ 77 | 78 | // Если вы знаете язык 79 | hljs.highlight(lang, code).value; 80 | 81 | // Автоопределение языка 82 | hljs.highlightAuto(code).value; 83 | }); 84 | ``` 85 | 86 | 87 | ## Замена TABов 88 | 89 | Также вы можете заменить символы TAB ('\x09'), используемые для отступов, на 90 | фиксированное количество пробелов или на отдельный ``, чтобы задать ему 91 | какой-нибудь специальный стиль: 92 | 93 | ```html 94 | 101 | ``` 102 | 103 | 104 | ## Инициализация вручную 105 | 106 | Если вы используете другие теги для блоков кода, вы можете инициализировать их 107 | явно с помощью функции `highlightBlock(code, tabReplace, useBR)`. Она принимает 108 | DOM-элемент с текстом расцвечиваемого кода и опционально - строчку для замены 109 | символов TAB. 110 | 111 | Например с использованием jQuery код инициализации может выглядеть так: 112 | 113 | ```javascript 114 | $(document).ready(function() { 115 | $('pre code').each(function(i, e) {hljs.highlightBlock(e)}); 116 | }); 117 | ``` 118 | 119 | `highlightBlock` можно также использовать, чтобы подсветить блоки кода, 120 | добавленные на страницу динамически. Только убедитесь, что вы не делаете этого 121 | повторно для уже раскрашенных блоков. 122 | 123 | Если ваш блок кода использует `
` вместо переводов строки (т.е. если это не 124 | `
`), передайте `true` третьим параметром в `highlightBlock`:
125 | 
126 | ```javascript
127 | $('div.code').each(function(i, e) {hljs.highlightBlock(e, null, true)});
128 | ```
129 | 
130 | 
131 | ## Эвристика
132 | 
133 | Определение языка, на котором написан фрагмент, делается с помощью
134 | довольно простой эвристики: программа пытается расцветить фрагмент всеми
135 | языками подряд, и для каждого языка считает количество подошедших
136 | синтаксически конструкций и ключевых слов. Для какого языка нашлось больше,
137 | тот и выбирается.
138 | 
139 | Это означает, что в коротких фрагментах высока вероятность ошибки, что
140 | периодически и случается. Чтобы указать язык фрагмента явно, надо написать
141 | его название в виде класса к элементу ``:
142 | 
143 | ```html
144 | 
...
145 | ``` 146 | 147 | Можно использовать рекомендованные в HTML5 названия классов: 148 | "language-html", "language-php". Также можно назначать классы на элемент 149 | `
`.
150 | 
151 | Чтобы запретить расцветку фрагмента вообще, используется класс "no-highlight":
152 | 
153 | ```html
154 | 
...
155 | ``` 156 | 157 | 158 | ## Экспорт 159 | 160 | В файле export.html находится небольшая программка, которая показывает и дает 161 | скопировать непосредственно HTML-код подсветки для любого заданного фрагмента кода. 162 | Это может понадобится например на сайте, на котором нельзя подключить сам скрипт 163 | highlight.js. 164 | 165 | 166 | ## Координаты 167 | 168 | - Версия: 7.5 169 | - URL: http://highlightjs.org/ 170 | 171 | Лицензионное соглашение читайте в файле LICENSE. 172 | Список авторов и соавторов читайте в файле AUTHORS.ru.txt 173 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/arta.css: -------------------------------------------------------------------------------- 1 | /* 2 | Date: 17.V.2011 3 | Author: pumbur 4 | */ 5 | 6 | pre code 7 | { 8 | display: block; padding: 0.5em; 9 | background: #222; 10 | } 11 | 12 | pre .profile .header *, 13 | pre .ini .title, 14 | pre .nginx .title 15 | { 16 | color: #fff; 17 | } 18 | 19 | pre .comment, 20 | pre .javadoc, 21 | pre .preprocessor, 22 | pre .preprocessor .title, 23 | pre .pragma, 24 | pre .shebang, 25 | pre .profile .summary, 26 | pre .diff, 27 | pre .pi, 28 | pre .doctype, 29 | pre .tag, 30 | pre .template_comment, 31 | pre .css .rules, 32 | pre .tex .special 33 | { 34 | color: #444; 35 | } 36 | 37 | pre .string, 38 | pre .symbol, 39 | pre .diff .change, 40 | pre .regexp, 41 | pre .xml .attribute, 42 | pre .smalltalk .char, 43 | pre .xml .value, 44 | pre .ini .value, 45 | pre .clojure .attribute, 46 | pre .coffeescript .attribute 47 | { 48 | color: #ffcc33; 49 | } 50 | 51 | pre .number, 52 | pre .addition 53 | { 54 | color: #00cc66; 55 | } 56 | 57 | pre .built_in, 58 | pre .literal, 59 | pre .vhdl .typename, 60 | pre .go .constant, 61 | pre .go .typename, 62 | pre .ini .keyword, 63 | pre .lua .title, 64 | pre .perl .variable, 65 | pre .php .variable, 66 | pre .mel .variable, 67 | pre .django .variable, 68 | pre .css .funtion, 69 | pre .smalltalk .method, 70 | pre .hexcolor, 71 | pre .important, 72 | pre .flow, 73 | pre .inheritance, 74 | pre .parser3 .variable 75 | { 76 | color: #32AAEE; 77 | } 78 | 79 | pre .keyword, 80 | pre .tag .title, 81 | pre .css .tag, 82 | pre .css .class, 83 | pre .css .id, 84 | pre .css .pseudo, 85 | pre .css .attr_selector, 86 | pre .lisp .title, 87 | pre .clojure .built_in, 88 | pre .winutils, 89 | pre .tex .command, 90 | pre .request, 91 | pre .status 92 | { 93 | color: #6644aa; 94 | } 95 | 96 | pre .title, 97 | pre .ruby .constant, 98 | pre .vala .constant, 99 | pre .parent, 100 | pre .deletion, 101 | pre .template_tag, 102 | pre .css .keyword, 103 | pre .objectivec .class .id, 104 | pre .smalltalk .class, 105 | pre .lisp .keyword, 106 | pre .apache .tag, 107 | pre .nginx .variable, 108 | pre .envvar, 109 | pre .bash .variable, 110 | pre .go .built_in, 111 | pre .vbscript .built_in, 112 | pre .lua .built_in, 113 | pre .rsl .built_in, 114 | pre .tail, 115 | pre .avrasm .label, 116 | pre .tex .formula, 117 | pre .tex .formula * 118 | { 119 | color: #bb1166; 120 | } 121 | 122 | pre .yardoctag, 123 | pre .phpdoc, 124 | pre .profile .header, 125 | pre .ini .title, 126 | pre .apache .tag, 127 | pre .parser3 .title 128 | { 129 | font-weight: bold; 130 | } 131 | 132 | pre .coffeescript .javascript, 133 | pre .javascript .xml, 134 | pre .tex .formula, 135 | pre .xml .javascript, 136 | pre .xml .vbscript, 137 | pre .xml .css, 138 | pre .xml .cdata 139 | { 140 | opacity: 0.6; 141 | } 142 | 143 | pre code, 144 | pre .javascript, 145 | pre .css, 146 | pre .xml, 147 | pre .subst, 148 | pre .diff .chunk, 149 | pre .css .value, 150 | pre .css .attribute, 151 | pre .lisp .string, 152 | pre .lisp .number, 153 | pre .tail .params, 154 | pre .container, 155 | pre .haskell *, 156 | pre .erlang *, 157 | pre .erlang_repl * 158 | { 159 | color: #aaa; 160 | } 161 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/ascetic.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: white; color: black; 10 | } 11 | 12 | pre .string, 13 | pre .tag .value, 14 | pre .filter .argument, 15 | pre .addition, 16 | pre .change, 17 | pre .apache .tag, 18 | pre .apache .cbracket, 19 | pre .nginx .built_in, 20 | pre .tex .formula { 21 | color: #888; 22 | } 23 | 24 | pre .comment, 25 | pre .template_comment, 26 | pre .shebang, 27 | pre .doctype, 28 | pre .pi, 29 | pre .javadoc, 30 | pre .deletion, 31 | pre .apache .sqbracket { 32 | color: #CCC; 33 | } 34 | 35 | pre .keyword, 36 | pre .tag .title, 37 | pre .ini .title, 38 | pre .lisp .title, 39 | pre .clojure .title, 40 | pre .http .title, 41 | pre .nginx .title, 42 | pre .css .tag, 43 | pre .winutils, 44 | pre .flow, 45 | pre .apache .tag, 46 | pre .tex .command, 47 | pre .request, 48 | pre .status { 49 | font-weight: bold; 50 | } 51 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/brown_paper.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Brown Paper style from goldblog.com.ua (c) Zaripov Yura 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background:#b7a68e url(./brown_papersq.png); 10 | } 11 | 12 | pre .keyword, 13 | pre .literal, 14 | pre .change, 15 | pre .winutils, 16 | pre .flow, 17 | pre .lisp .title, 18 | pre .clojure .built_in, 19 | pre .nginx .title, 20 | pre .tex .special, 21 | pre .request, 22 | pre .status { 23 | color:#005599; 24 | font-weight:bold; 25 | } 26 | 27 | pre code, 28 | pre .subst, 29 | pre .tag .keyword { 30 | color: #363C69; 31 | } 32 | 33 | pre .string, 34 | pre .title, 35 | pre .haskell .type, 36 | pre .tag .value, 37 | pre .css .rules .value, 38 | pre .preprocessor, 39 | pre .pragma, 40 | pre .ruby .symbol, 41 | pre .ruby .symbol .string, 42 | pre .ruby .class .parent, 43 | pre .built_in, 44 | pre .sql .aggregate, 45 | pre .django .template_tag, 46 | pre .django .variable, 47 | pre .smalltalk .class, 48 | pre .javadoc, 49 | pre .ruby .string, 50 | pre .django .filter .argument, 51 | pre .smalltalk .localvars, 52 | pre .smalltalk .array, 53 | pre .attr_selector, 54 | pre .pseudo, 55 | pre .addition, 56 | pre .stream, 57 | pre .envvar, 58 | pre .apache .tag, 59 | pre .apache .cbracket, 60 | pre .tex .number { 61 | color: #2C009F; 62 | } 63 | 64 | pre .comment, 65 | pre .java .annotation, 66 | pre .python .decorator, 67 | pre .template_comment, 68 | pre .pi, 69 | pre .doctype, 70 | pre .deletion, 71 | pre .shebang, 72 | pre .apache .sqbracket, 73 | pre .nginx .built_in, 74 | pre .tex .formula { 75 | color: #802022; 76 | } 77 | 78 | pre .keyword, 79 | pre .literal, 80 | pre .css .id, 81 | pre .phpdoc, 82 | pre .title, 83 | pre .haskell .type, 84 | pre .vbscript .built_in, 85 | pre .sql .aggregate, 86 | pre .rsl .built_in, 87 | pre .smalltalk .class, 88 | pre .diff .header, 89 | pre .chunk, 90 | pre .winutils, 91 | pre .bash .variable, 92 | pre .apache .tag, 93 | pre .tex .command { 94 | font-weight: bold; 95 | } 96 | 97 | pre .coffeescript .javascript, 98 | pre .javascript .xml, 99 | pre .tex .formula, 100 | pre .xml .javascript, 101 | pre .xml .vbscript, 102 | pre .xml .css, 103 | pre .xml .cdata { 104 | opacity: 0.8; 105 | } 106 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/brown_papersq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/support/html/highlightjs/styles/brown_papersq.png -------------------------------------------------------------------------------- /support/html/highlightjs/styles/dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Dark style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #444; 10 | } 11 | 12 | pre .keyword, 13 | pre .literal, 14 | pre .change, 15 | pre .winutils, 16 | pre .flow, 17 | pre .lisp .title, 18 | pre .clojure .built_in, 19 | pre .nginx .title, 20 | pre .tex .special { 21 | color: white; 22 | } 23 | 24 | pre code, 25 | pre .subst { 26 | color: #DDD; 27 | } 28 | 29 | pre .string, 30 | pre .title, 31 | pre .haskell .type, 32 | pre .ini .title, 33 | pre .tag .value, 34 | pre .css .rules .value, 35 | pre .preprocessor, 36 | pre .pragma, 37 | pre .ruby .symbol, 38 | pre .ruby .symbol .string, 39 | pre .ruby .class .parent, 40 | pre .built_in, 41 | pre .sql .aggregate, 42 | pre .django .template_tag, 43 | pre .django .variable, 44 | pre .smalltalk .class, 45 | pre .javadoc, 46 | pre .ruby .string, 47 | pre .django .filter .argument, 48 | pre .smalltalk .localvars, 49 | pre .smalltalk .array, 50 | pre .attr_selector, 51 | pre .pseudo, 52 | pre .addition, 53 | pre .stream, 54 | pre .envvar, 55 | pre .apache .tag, 56 | pre .apache .cbracket, 57 | pre .tex .command, 58 | pre .prompt, 59 | pre .coffeescript .attribute { 60 | color: #D88; 61 | } 62 | 63 | pre .comment, 64 | pre .java .annotation, 65 | pre .python .decorator, 66 | pre .template_comment, 67 | pre .pi, 68 | pre .doctype, 69 | pre .deletion, 70 | pre .shebang, 71 | pre .apache .sqbracket, 72 | pre .tex .formula { 73 | color: #777; 74 | } 75 | 76 | pre .keyword, 77 | pre .literal, 78 | pre .title, 79 | pre .css .id, 80 | pre .phpdoc, 81 | pre .haskell .type, 82 | pre .vbscript .built_in, 83 | pre .sql .aggregate, 84 | pre .rsl .built_in, 85 | pre .smalltalk .class, 86 | pre .diff .header, 87 | pre .chunk, 88 | pre .winutils, 89 | pre .bash .variable, 90 | pre .apache .tag, 91 | pre .tex .special, 92 | pre .request, 93 | pre .status { 94 | font-weight: bold; 95 | } 96 | 97 | pre .coffeescript .javascript, 98 | pre .javascript .xml, 99 | pre .tex .formula, 100 | pre .xml .javascript, 101 | pre .xml .vbscript, 102 | pre .xml .css, 103 | pre .xml .cdata { 104 | opacity: 0.5; 105 | } 106 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/default.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Original style from softwaremaniacs.org (c) Ivan Sagalaev 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #F0F0F0; 10 | } 11 | 12 | pre code, 13 | pre .subst, 14 | pre .tag .title, 15 | pre .lisp .title, 16 | pre .clojure .built_in, 17 | pre .nginx .title { 18 | color: black; 19 | } 20 | 21 | pre .string, 22 | pre .title, 23 | pre .constant, 24 | pre .parent, 25 | pre .tag .value, 26 | pre .rules .value, 27 | pre .rules .value .number, 28 | pre .preprocessor, 29 | pre .pragma, 30 | pre .haml .symbol, 31 | pre .ruby .symbol, 32 | pre .ruby .symbol .string, 33 | pre .aggregate, 34 | pre .template_tag, 35 | pre .django .variable, 36 | pre .smalltalk .class, 37 | pre .addition, 38 | pre .flow, 39 | pre .stream, 40 | pre .bash .variable, 41 | pre .apache .tag, 42 | pre .apache .cbracket, 43 | pre .tex .command, 44 | pre .tex .special, 45 | pre .erlang_repl .function_or_atom, 46 | pre .asciidoc .header, 47 | pre .markdown .header, 48 | pre .coffeescript .attribute { 49 | color: #800; 50 | } 51 | 52 | pre .smartquote, 53 | pre .comment, 54 | pre .annotation, 55 | pre .template_comment, 56 | pre .diff .header, 57 | pre .chunk, 58 | pre .asciidoc .blockquote, 59 | pre .markdown .blockquote { 60 | color: #888; 61 | } 62 | 63 | pre .number, 64 | pre .date, 65 | pre .regexp, 66 | pre .literal, 67 | pre .hexcolor, 68 | pre .smalltalk .symbol, 69 | pre .smalltalk .char, 70 | pre .go .constant, 71 | pre .change, 72 | pre .lasso .variable, 73 | pre .makefile .variable, 74 | pre .asciidoc .bullet, 75 | pre .markdown .bullet, 76 | pre .asciidoc .link_url, 77 | pre .markdown .link_url { 78 | color: #080; 79 | } 80 | 81 | pre .label, 82 | pre .javadoc, 83 | pre .ruby .string, 84 | pre .decorator, 85 | pre .filter .argument, 86 | pre .localvars, 87 | pre .array, 88 | pre .attr_selector, 89 | pre .important, 90 | pre .pseudo, 91 | pre .pi, 92 | pre .haml .bullet, 93 | pre .doctype, 94 | pre .deletion, 95 | pre .envvar, 96 | pre .shebang, 97 | pre .apache .sqbracket, 98 | pre .nginx .built_in, 99 | pre .tex .formula, 100 | pre .erlang_repl .reserved, 101 | pre .prompt, 102 | pre .asciidoc .link_label, 103 | pre .markdown .link_label, 104 | pre .vhdl .attribute, 105 | pre .clojure .attribute, 106 | pre .asciidoc .attribute, 107 | pre .lasso .attribute, 108 | pre .coffeescript .property, 109 | pre .makefile .phony { 110 | color: #88F 111 | } 112 | 113 | pre .keyword, 114 | pre .id, 115 | pre .title, 116 | pre .built_in, 117 | pre .aggregate, 118 | pre .css .tag, 119 | pre .javadoctag, 120 | pre .phpdoc, 121 | pre .yardoctag, 122 | pre .smalltalk .class, 123 | pre .winutils, 124 | pre .bash .variable, 125 | pre .apache .tag, 126 | pre .go .typename, 127 | pre .tex .command, 128 | pre .asciidoc .strong, 129 | pre .markdown .strong, 130 | pre .request, 131 | pre .status { 132 | font-weight: bold; 133 | } 134 | 135 | pre .asciidoc .emphasis, 136 | pre .markdown .emphasis { 137 | font-style: italic; 138 | } 139 | 140 | pre .nginx .built_in { 141 | font-weight: normal; 142 | } 143 | 144 | pre .coffeescript .javascript, 145 | pre .javascript .xml, 146 | pre .lasso .markup, 147 | pre .tex .formula, 148 | pre .xml .javascript, 149 | pre .xml .vbscript, 150 | pre .xml .css, 151 | pre .xml .cdata { 152 | opacity: 0.5; 153 | } 154 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/docco.css: -------------------------------------------------------------------------------- 1 | /* 2 | Docco style used in http://jashkenas.github.com/docco/ converted by Simon Madine (@thingsinjars) 3 | */ 4 | 5 | pre code { 6 | display: block; padding: 0.5em; 7 | color: #000; 8 | background: #f8f8ff 9 | } 10 | 11 | pre .comment, 12 | pre .template_comment, 13 | pre .diff .header, 14 | pre .javadoc { 15 | color: #408080; 16 | font-style: italic 17 | } 18 | 19 | pre .keyword, 20 | pre .assignment, 21 | pre .literal, 22 | pre .css .rule .keyword, 23 | pre .winutils, 24 | pre .javascript .title, 25 | pre .lisp .title, 26 | pre .subst { 27 | color: #954121; 28 | } 29 | 30 | pre .number, 31 | pre .hexcolor { 32 | color: #40a070 33 | } 34 | 35 | pre .string, 36 | pre .tag .value, 37 | pre .phpdoc, 38 | pre .tex .formula { 39 | color: #219161; 40 | } 41 | 42 | pre .title, 43 | pre .id { 44 | color: #19469D; 45 | } 46 | pre .params { 47 | color: #00F; 48 | } 49 | 50 | pre .javascript .title, 51 | pre .lisp .title, 52 | pre .subst { 53 | font-weight: normal 54 | } 55 | 56 | pre .class .title, 57 | pre .haskell .label, 58 | pre .tex .command { 59 | color: #458; 60 | font-weight: bold 61 | } 62 | 63 | pre .tag, 64 | pre .tag .title, 65 | pre .rules .property, 66 | pre .django .tag .keyword { 67 | color: #000080; 68 | font-weight: normal 69 | } 70 | 71 | pre .attribute, 72 | pre .variable, 73 | pre .instancevar, 74 | pre .lisp .body { 75 | color: #008080 76 | } 77 | 78 | pre .regexp { 79 | color: #B68 80 | } 81 | 82 | pre .class { 83 | color: #458; 84 | font-weight: bold 85 | } 86 | 87 | pre .symbol, 88 | pre .ruby .symbol .string, 89 | pre .ruby .symbol .keyword, 90 | pre .ruby .symbol .keymethods, 91 | pre .lisp .keyword, 92 | pre .tex .special, 93 | pre .input_number { 94 | color: #990073 95 | } 96 | 97 | pre .builtin, 98 | pre .constructor, 99 | pre .built_in, 100 | pre .lisp .title { 101 | color: #0086b3 102 | } 103 | 104 | pre .preprocessor, 105 | pre .pragma, 106 | pre .pi, 107 | pre .doctype, 108 | pre .shebang, 109 | pre .cdata { 110 | color: #999; 111 | font-weight: bold 112 | } 113 | 114 | pre .deletion { 115 | background: #fdd 116 | } 117 | 118 | pre .addition { 119 | background: #dfd 120 | } 121 | 122 | pre .diff .change { 123 | background: #0086b3 124 | } 125 | 126 | pre .chunk { 127 | color: #aaa 128 | } 129 | 130 | pre .tex .formula { 131 | opacity: 0.5; 132 | } 133 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/far.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | FAR Style (c) MajestiC 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #000080; 10 | } 11 | 12 | pre code, 13 | pre .subst { 14 | color: #0FF; 15 | } 16 | 17 | pre .string, 18 | pre .ruby .string, 19 | pre .haskell .type, 20 | pre .tag .value, 21 | pre .css .rules .value, 22 | pre .css .rules .value .number, 23 | pre .preprocessor, 24 | pre .pragma, 25 | pre .ruby .symbol, 26 | pre .ruby .symbol .string, 27 | pre .built_in, 28 | pre .sql .aggregate, 29 | pre .django .template_tag, 30 | pre .django .variable, 31 | pre .smalltalk .class, 32 | pre .addition, 33 | pre .apache .tag, 34 | pre .apache .cbracket, 35 | pre .tex .command, 36 | pre .clojure .title, 37 | pre .coffeescript .attribute { 38 | color: #FF0; 39 | } 40 | 41 | pre .keyword, 42 | pre .css .id, 43 | pre .title, 44 | pre .haskell .type, 45 | pre .vbscript .built_in, 46 | pre .sql .aggregate, 47 | pre .rsl .built_in, 48 | pre .smalltalk .class, 49 | pre .xml .tag .title, 50 | pre .winutils, 51 | pre .flow, 52 | pre .change, 53 | pre .envvar, 54 | pre .bash .variable, 55 | pre .tex .special, 56 | pre .clojure .built_in { 57 | color: #FFF; 58 | } 59 | 60 | pre .comment, 61 | pre .phpdoc, 62 | pre .javadoc, 63 | pre .java .annotation, 64 | pre .template_comment, 65 | pre .deletion, 66 | pre .apache .sqbracket, 67 | pre .tex .formula { 68 | color: #888; 69 | } 70 | 71 | pre .number, 72 | pre .date, 73 | pre .regexp, 74 | pre .literal, 75 | pre .smalltalk .symbol, 76 | pre .smalltalk .char, 77 | pre .clojure .attribute { 78 | color: #0F0; 79 | } 80 | 81 | pre .python .decorator, 82 | pre .django .filter .argument, 83 | pre .smalltalk .localvars, 84 | pre .smalltalk .array, 85 | pre .attr_selector, 86 | pre .pseudo, 87 | pre .xml .pi, 88 | pre .diff .header, 89 | pre .chunk, 90 | pre .shebang, 91 | pre .nginx .built_in, 92 | pre .prompt { 93 | color: #008080; 94 | } 95 | 96 | pre .keyword, 97 | pre .css .id, 98 | pre .title, 99 | pre .haskell .type, 100 | pre .vbscript .built_in, 101 | pre .sql .aggregate, 102 | pre .rsl .built_in, 103 | pre .smalltalk .class, 104 | pre .winutils, 105 | pre .flow, 106 | pre .apache .tag, 107 | pre .nginx .built_in, 108 | pre .tex .command, 109 | pre .tex .special, 110 | pre .request, 111 | pre .status { 112 | font-weight: bold; 113 | } 114 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/foundation.css: -------------------------------------------------------------------------------- 1 | /* 2 | Description: Foundation 4 docs style for highlight.js 3 | Author: Dan Allen 4 | Website: http://foundation.zurb.com/docs/ 5 | Version: 1.0 6 | Date: 2013-04-02 7 | */ 8 | 9 | pre code { 10 | display: block; padding: 0.5em; 11 | background: #eee; 12 | } 13 | 14 | pre .header, 15 | pre .decorator, 16 | pre .annotation { 17 | color: #000077; 18 | } 19 | 20 | pre .horizontal_rule, 21 | pre .link_url, 22 | pre .emphasis, 23 | pre .attribute { 24 | color: #070; 25 | } 26 | 27 | pre .emphasis { 28 | font-style: italic; 29 | } 30 | 31 | pre .link_label, 32 | pre .strong, 33 | pre .value, 34 | pre .string, 35 | pre .scss .value .string { 36 | color: #d14; 37 | } 38 | 39 | pre .strong { 40 | font-weight: bold; 41 | } 42 | 43 | pre .blockquote, 44 | pre .comment { 45 | color: #998; 46 | font-style: italic; 47 | } 48 | 49 | pre .asciidoc .title, 50 | pre .function .title { 51 | color: #900; 52 | } 53 | 54 | pre .class { 55 | color: #458; 56 | } 57 | 58 | pre .id, 59 | pre .pseudo, 60 | pre .constant, 61 | pre .hexcolor { 62 | color: teal; 63 | } 64 | 65 | pre .variable { 66 | color: #336699; 67 | } 68 | 69 | pre .bullet, 70 | pre .javadoc { 71 | color: #997700; 72 | } 73 | 74 | pre .pi, 75 | pre .doctype { 76 | color: #3344bb; 77 | } 78 | 79 | pre .code, 80 | pre .number { 81 | color: #099; 82 | } 83 | 84 | pre .important { 85 | color: #f00; 86 | } 87 | 88 | pre .smartquote, 89 | pre .label { 90 | color: #970; 91 | } 92 | 93 | pre .preprocessor, 94 | pre .pragma { 95 | color: #579; 96 | } 97 | 98 | pre .reserved, 99 | pre .keyword, 100 | pre .scss .value { 101 | color: #000; 102 | } 103 | 104 | pre .regexp { 105 | background-color: #fff0ff; 106 | color: #880088; 107 | } 108 | 109 | pre .symbol { 110 | color: #990073; 111 | } 112 | 113 | pre .symbol .string { 114 | color: #a60; 115 | } 116 | 117 | pre .tag { 118 | color: #007700; 119 | } 120 | 121 | pre .at_rule, 122 | pre .at_rule .keyword { 123 | color: #088; 124 | } 125 | 126 | pre .at_rule .preprocessor { 127 | color: #808; 128 | } 129 | 130 | pre .scss .tag, 131 | pre .scss .attribute { 132 | color: #339; 133 | } 134 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/github.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | github.com style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | color: #333; 10 | background: #f8f8ff 11 | } 12 | 13 | pre .comment, 14 | pre .template_comment, 15 | pre .diff .header, 16 | pre .javadoc { 17 | color: #998; 18 | font-style: italic 19 | } 20 | 21 | pre .keyword, 22 | pre .css .rule .keyword, 23 | pre .winutils, 24 | pre .javascript .title, 25 | pre .nginx .title, 26 | pre .subst, 27 | pre .request, 28 | pre .status { 29 | color: #333; 30 | font-weight: bold 31 | } 32 | 33 | pre .number, 34 | pre .hexcolor, 35 | pre .ruby .constant { 36 | color: #099; 37 | } 38 | 39 | pre .string, 40 | pre .tag .value, 41 | pre .phpdoc, 42 | pre .tex .formula { 43 | color: #d14 44 | } 45 | 46 | pre .title, 47 | pre .id, 48 | pre .coffeescript .params, 49 | pre .scss .preprocessor { 50 | color: #900; 51 | font-weight: bold 52 | } 53 | 54 | pre .javascript .title, 55 | pre .lisp .title, 56 | pre .clojure .title, 57 | pre .subst { 58 | font-weight: normal 59 | } 60 | 61 | pre .class .title, 62 | pre .haskell .type, 63 | pre .vhdl .literal, 64 | pre .tex .command { 65 | color: #458; 66 | font-weight: bold 67 | } 68 | 69 | pre .tag, 70 | pre .tag .title, 71 | pre .rules .property, 72 | pre .django .tag .keyword { 73 | color: #000080; 74 | font-weight: normal 75 | } 76 | 77 | pre .attribute, 78 | pre .variable, 79 | pre .lisp .body { 80 | color: #008080 81 | } 82 | 83 | pre .regexp { 84 | color: #009926 85 | } 86 | 87 | pre .class { 88 | color: #458; 89 | font-weight: bold 90 | } 91 | 92 | pre .symbol, 93 | pre .ruby .symbol .string, 94 | pre .lisp .keyword, 95 | pre .tex .special, 96 | pre .prompt { 97 | color: #990073 98 | } 99 | 100 | pre .built_in, 101 | pre .lisp .title, 102 | pre .clojure .built_in { 103 | color: #0086b3 104 | } 105 | 106 | pre .preprocessor, 107 | pre .pragma, 108 | pre .pi, 109 | pre .doctype, 110 | pre .shebang, 111 | pre .cdata { 112 | color: #999; 113 | font-weight: bold 114 | } 115 | 116 | pre .deletion { 117 | background: #fdd 118 | } 119 | 120 | pre .addition { 121 | background: #dfd 122 | } 123 | 124 | pre .diff .change { 125 | background: #0086b3 126 | } 127 | 128 | pre .chunk { 129 | color: #aaa 130 | } 131 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/googlecode.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Google Code style (c) Aahan Krish 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: white; color: black; 10 | } 11 | 12 | pre .comment, 13 | pre .template_comment, 14 | pre .javadoc, 15 | pre .comment * { 16 | color: #800; 17 | } 18 | 19 | pre .keyword, 20 | pre .method, 21 | pre .list .title, 22 | pre .clojure .built_in, 23 | pre .nginx .title, 24 | pre .tag .title, 25 | pre .setting .value, 26 | pre .winutils, 27 | pre .tex .command, 28 | pre .http .title, 29 | pre .request, 30 | pre .status { 31 | color: #008; 32 | } 33 | 34 | pre .envvar, 35 | pre .tex .special { 36 | color: #660; 37 | } 38 | 39 | pre .string, 40 | pre .tag .value, 41 | pre .cdata, 42 | pre .filter .argument, 43 | pre .attr_selector, 44 | pre .apache .cbracket, 45 | pre .date, 46 | pre .regexp, 47 | pre .coffeescript .attribute { 48 | color: #080; 49 | } 50 | 51 | pre .sub .identifier, 52 | pre .pi, 53 | pre .tag, 54 | pre .tag .keyword, 55 | pre .decorator, 56 | pre .ini .title, 57 | pre .shebang, 58 | pre .prompt, 59 | pre .hexcolor, 60 | pre .rules .value, 61 | pre .css .value .number, 62 | pre .literal, 63 | pre .symbol, 64 | pre .ruby .symbol .string, 65 | pre .number, 66 | pre .css .function, 67 | pre .clojure .attribute { 68 | color: #066; 69 | } 70 | 71 | pre .class .title, 72 | pre .haskell .type, 73 | pre .smalltalk .class, 74 | pre .javadoctag, 75 | pre .yardoctag, 76 | pre .phpdoc, 77 | pre .typename, 78 | pre .tag .attribute, 79 | pre .doctype, 80 | pre .class .id, 81 | pre .built_in, 82 | pre .setting, 83 | pre .params, 84 | pre .variable, 85 | pre .clojure .title { 86 | color: #606; 87 | } 88 | 89 | pre .css .tag, 90 | pre .rules .property, 91 | pre .pseudo, 92 | pre .subst { 93 | color: #000; 94 | } 95 | 96 | pre .css .class, pre .css .id { 97 | color: #9B703F; 98 | } 99 | 100 | pre .value .important { 101 | color: #ff7700; 102 | font-weight: bold; 103 | } 104 | 105 | pre .rules .keyword { 106 | color: #C5AF75; 107 | } 108 | 109 | pre .annotation, 110 | pre .apache .sqbracket, 111 | pre .nginx .built_in { 112 | color: #9B859D; 113 | } 114 | 115 | pre .preprocessor, 116 | pre .preprocessor *, 117 | pre .pragma { 118 | color: #444; 119 | } 120 | 121 | pre .tex .formula { 122 | background-color: #EEE; 123 | font-style: italic; 124 | } 125 | 126 | pre .diff .header, 127 | pre .chunk { 128 | color: #808080; 129 | font-weight: bold; 130 | } 131 | 132 | pre .diff .change { 133 | background-color: #BCCFF9; 134 | } 135 | 136 | pre .addition { 137 | background-color: #BAEEBA; 138 | } 139 | 140 | pre .deletion { 141 | background-color: #FFC8BD; 142 | } 143 | 144 | pre .comment .yardoctag { 145 | font-weight: bold; 146 | } 147 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/idea.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Intellij Idea-like styling (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | color: #000; 10 | background: #fff; 11 | } 12 | 13 | pre .subst, 14 | pre .title { 15 | font-weight: normal; 16 | color: #000; 17 | } 18 | 19 | pre .comment, 20 | pre .template_comment, 21 | pre .javadoc, 22 | pre .diff .header { 23 | color: #808080; 24 | font-style: italic; 25 | } 26 | 27 | pre .annotation, 28 | pre .decorator, 29 | pre .preprocessor, 30 | pre .pragma, 31 | pre .doctype, 32 | pre .pi, 33 | pre .chunk, 34 | pre .shebang, 35 | pre .apache .cbracket, 36 | pre .prompt, 37 | pre .http .title { 38 | color: #808000; 39 | } 40 | 41 | pre .tag, 42 | pre .pi { 43 | background: #efefef; 44 | } 45 | 46 | pre .tag .title, 47 | pre .id, 48 | pre .attr_selector, 49 | pre .pseudo, 50 | pre .literal, 51 | pre .keyword, 52 | pre .hexcolor, 53 | pre .css .function, 54 | pre .ini .title, 55 | pre .css .class, 56 | pre .list .title, 57 | pre .clojure .title, 58 | pre .nginx .title, 59 | pre .tex .command, 60 | pre .request, 61 | pre .status { 62 | font-weight: bold; 63 | color: #000080; 64 | } 65 | 66 | pre .attribute, 67 | pre .rules .keyword, 68 | pre .number, 69 | pre .date, 70 | pre .regexp, 71 | pre .tex .special { 72 | font-weight: bold; 73 | color: #0000ff; 74 | } 75 | 76 | pre .number, 77 | pre .regexp { 78 | font-weight: normal; 79 | } 80 | 81 | pre .string, 82 | pre .value, 83 | pre .filter .argument, 84 | pre .css .function .params, 85 | pre .apache .tag { 86 | color: #008000; 87 | font-weight: bold; 88 | } 89 | 90 | pre .symbol, 91 | pre .ruby .symbol .string, 92 | pre .char, 93 | pre .tex .formula { 94 | color: #000; 95 | background: #d0eded; 96 | font-style: italic; 97 | } 98 | 99 | pre .phpdoc, 100 | pre .yardoctag, 101 | pre .javadoctag { 102 | text-decoration: underline; 103 | } 104 | 105 | pre .variable, 106 | pre .envvar, 107 | pre .apache .sqbracket, 108 | pre .nginx .built_in { 109 | color: #660e7a; 110 | } 111 | 112 | pre .addition { 113 | background: #baeeba; 114 | } 115 | 116 | pre .deletion { 117 | background: #ffc8bd; 118 | } 119 | 120 | pre .diff .change { 121 | background: #bccff9; 122 | } 123 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/ir_black.css: -------------------------------------------------------------------------------- 1 | /* 2 | IR_Black style (c) Vasily Mikhailitchenko 3 | */ 4 | 5 | pre code { 6 | display: block; padding: 0.5em; 7 | background: #000; color: #f8f8f8; 8 | } 9 | 10 | pre .shebang, 11 | pre .comment, 12 | pre .template_comment, 13 | pre .javadoc { 14 | color: #7c7c7c; 15 | } 16 | 17 | pre .keyword, 18 | pre .tag, 19 | pre .tex .command, 20 | pre .request, 21 | pre .status, 22 | pre .clojure .attribute { 23 | color: #96CBFE; 24 | } 25 | 26 | pre .sub .keyword, 27 | pre .method, 28 | pre .list .title, 29 | pre .nginx .title { 30 | color: #FFFFB6; 31 | } 32 | 33 | pre .string, 34 | pre .tag .value, 35 | pre .cdata, 36 | pre .filter .argument, 37 | pre .attr_selector, 38 | pre .apache .cbracket, 39 | pre .date, 40 | pre .coffeescript .attribute { 41 | color: #A8FF60; 42 | } 43 | 44 | pre .subst { 45 | color: #DAEFA3; 46 | } 47 | 48 | pre .regexp { 49 | color: #E9C062; 50 | } 51 | 52 | pre .title, 53 | pre .sub .identifier, 54 | pre .pi, 55 | pre .decorator, 56 | pre .tex .special, 57 | pre .haskell .type, 58 | pre .constant, 59 | pre .smalltalk .class, 60 | pre .javadoctag, 61 | pre .yardoctag, 62 | pre .phpdoc, 63 | pre .nginx .built_in { 64 | color: #FFFFB6; 65 | } 66 | 67 | pre .symbol, 68 | pre .ruby .symbol .string, 69 | pre .number, 70 | pre .variable, 71 | pre .vbscript, 72 | pre .literal { 73 | color: #C6C5FE; 74 | } 75 | 76 | pre .css .tag { 77 | color: #96CBFE; 78 | } 79 | 80 | pre .css .rules .property, 81 | pre .css .id { 82 | color: #FFFFB6; 83 | } 84 | 85 | pre .css .class { 86 | color: #FFF; 87 | } 88 | 89 | pre .hexcolor { 90 | color: #C6C5FE; 91 | } 92 | 93 | pre .number { 94 | color:#FF73FD; 95 | } 96 | 97 | pre .coffeescript .javascript, 98 | pre .javascript .xml, 99 | pre .tex .formula, 100 | pre .xml .javascript, 101 | pre .xml .vbscript, 102 | pre .xml .css, 103 | pre .xml .cdata { 104 | opacity: 0.7; 105 | } 106 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/magula.css: -------------------------------------------------------------------------------- 1 | /* 2 | Description: Magula style for highligh.js 3 | Author: Ruslan Keba 4 | Website: http://rukeba.com/ 5 | Version: 1.0 6 | Date: 2009-01-03 7 | Music: Aphex Twin / Xtal 8 | */ 9 | 10 | pre code { 11 | display: block; padding: 0.5em; 12 | background-color: #f4f4f4; 13 | } 14 | 15 | pre code, 16 | pre .subst, 17 | pre .lisp .title, 18 | pre .clojure .built_in { 19 | color: black; 20 | } 21 | 22 | pre .string, 23 | pre .title, 24 | pre .parent, 25 | pre .tag .value, 26 | pre .rules .value, 27 | pre .rules .value .number, 28 | pre .preprocessor, 29 | pre .pragma, 30 | pre .ruby .symbol, 31 | pre .ruby .symbol .string, 32 | pre .aggregate, 33 | pre .template_tag, 34 | pre .django .variable, 35 | pre .smalltalk .class, 36 | pre .addition, 37 | pre .flow, 38 | pre .stream, 39 | pre .bash .variable, 40 | pre .apache .cbracket, 41 | pre .coffeescript .attribute { 42 | color: #050; 43 | } 44 | 45 | pre .comment, 46 | pre .annotation, 47 | pre .template_comment, 48 | pre .diff .header, 49 | pre .chunk { 50 | color: #777; 51 | } 52 | 53 | pre .number, 54 | pre .date, 55 | pre .regexp, 56 | pre .literal, 57 | pre .smalltalk .symbol, 58 | pre .smalltalk .char, 59 | pre .change, 60 | pre .tex .special { 61 | color: #800; 62 | } 63 | 64 | pre .label, 65 | pre .javadoc, 66 | pre .ruby .string, 67 | pre .decorator, 68 | pre .filter .argument, 69 | pre .localvars, 70 | pre .array, 71 | pre .attr_selector, 72 | pre .pseudo, 73 | pre .pi, 74 | pre .doctype, 75 | pre .deletion, 76 | pre .envvar, 77 | pre .shebang, 78 | pre .apache .sqbracket, 79 | pre .nginx .built_in, 80 | pre .tex .formula, 81 | pre .prompt, 82 | pre .clojure .attribute { 83 | color: #00e; 84 | } 85 | 86 | pre .keyword, 87 | pre .id, 88 | pre .phpdoc, 89 | pre .title, 90 | pre .built_in, 91 | pre .aggregate, 92 | pre .smalltalk .class, 93 | pre .winutils, 94 | pre .bash .variable, 95 | pre .apache .tag, 96 | pre .xml .tag, 97 | pre .tex .command, 98 | pre .request, 99 | pre .status { 100 | font-weight: bold; 101 | color: navy; 102 | } 103 | 104 | pre .nginx .built_in { 105 | font-weight: normal; 106 | } 107 | 108 | pre .coffeescript .javascript, 109 | pre .javascript .xml, 110 | pre .tex .formula, 111 | pre .xml .javascript, 112 | pre .xml .vbscript, 113 | pre .xml .css, 114 | pre .xml .cdata { 115 | opacity: 0.5; 116 | } 117 | 118 | /* --- */ 119 | pre .apache .tag { 120 | font-weight: bold; 121 | color: blue; 122 | } 123 | 124 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/mono-blue.css: -------------------------------------------------------------------------------- 1 | /* 2 | Five-color theme from a single blue hue. 3 | */ 4 | pre code { 5 | display: block; padding: 0.5em; 6 | background: #EAEEF3; color: #00193A; 7 | } 8 | 9 | pre .keyword, 10 | pre .title, 11 | pre .important, 12 | pre .request, 13 | pre .header, 14 | pre .javadoctag { 15 | font-weight: bold; 16 | } 17 | 18 | pre .comment, 19 | pre .chunk, 20 | pre .template_comment { 21 | color: #738191; 22 | } 23 | 24 | pre .string, 25 | pre .title, 26 | pre .parent, 27 | pre .built_in, 28 | pre .literal, 29 | pre .filename, 30 | pre .value, 31 | pre .addition, 32 | pre .tag, 33 | pre .argument, 34 | pre .link_label, 35 | pre .blockquote, 36 | pre .header { 37 | color: #0048AB; 38 | } 39 | 40 | pre .decorator, 41 | pre .prompt, 42 | pre .yardoctag, 43 | pre .subst, 44 | pre .symbol, 45 | pre .doctype, 46 | pre .regexp, 47 | pre .preprocessor, 48 | pre .pragma, 49 | pre .pi, 50 | pre .attribute, 51 | pre .attr_selector, 52 | pre .javadoc, 53 | pre .xmlDocTag, 54 | pre .deletion, 55 | pre .shebang, 56 | pre .string .variable, 57 | pre .link_url, 58 | pre .bullet, 59 | pre .sqbracket, 60 | pre .phony { 61 | color: #4C81C9; 62 | } 63 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/monokai.css: -------------------------------------------------------------------------------- 1 | /* 2 | Monokai style - ported by Luigi Maselli - http://grigio.org 3 | */ 4 | 5 | pre code { 6 | display: block; padding: 0.5em; 7 | background: #272822; 8 | } 9 | 10 | pre .tag, 11 | pre .tag .title, 12 | pre .keyword, 13 | pre .literal, 14 | pre .strong, 15 | pre .change, 16 | pre .winutils, 17 | pre .flow, 18 | pre .lisp .title, 19 | pre .clojure .built_in, 20 | pre .nginx .title, 21 | pre .tex .special { 22 | color: #F92672; 23 | } 24 | 25 | pre code { 26 | color: #DDD; 27 | } 28 | 29 | pre code .constant, 30 | pre .asciidoc .code { 31 | color: #66D9EF; 32 | } 33 | 34 | pre .code, 35 | pre .class .title, 36 | pre .header { 37 | color: white; 38 | } 39 | 40 | pre .link_label, 41 | pre .attribute, 42 | pre .symbol, 43 | pre .symbol .string, 44 | pre .value, 45 | pre .regexp { 46 | color: #BF79DB; 47 | } 48 | 49 | pre .link_url, 50 | pre .tag .value, 51 | pre .string, 52 | pre .bullet, 53 | pre .subst, 54 | pre .title, 55 | pre .emphasis, 56 | pre .haskell .type, 57 | pre .preprocessor, 58 | pre .pragma, 59 | pre .ruby .class .parent, 60 | pre .built_in, 61 | pre .sql .aggregate, 62 | pre .django .template_tag, 63 | pre .django .variable, 64 | pre .smalltalk .class, 65 | pre .javadoc, 66 | pre .django .filter .argument, 67 | pre .smalltalk .localvars, 68 | pre .smalltalk .array, 69 | pre .attr_selector, 70 | pre .pseudo, 71 | pre .addition, 72 | pre .stream, 73 | pre .envvar, 74 | pre .apache .tag, 75 | pre .apache .cbracket, 76 | pre .tex .command, 77 | pre .prompt { 78 | color: #A6E22E; 79 | } 80 | 81 | pre .comment, 82 | pre .java .annotation, 83 | pre .smartquote, 84 | pre .blockquote, 85 | pre .horizontal_rule, 86 | pre .python .decorator, 87 | pre .template_comment, 88 | pre .pi, 89 | pre .doctype, 90 | pre .deletion, 91 | pre .shebang, 92 | pre .apache .sqbracket, 93 | pre .tex .formula { 94 | color: #75715E; 95 | } 96 | 97 | pre .keyword, 98 | pre .literal, 99 | pre .css .id, 100 | pre .phpdoc, 101 | pre .title, 102 | pre .header, 103 | pre .haskell .type, 104 | pre .vbscript .built_in, 105 | pre .sql .aggregate, 106 | pre .rsl .built_in, 107 | pre .smalltalk .class, 108 | pre .diff .header, 109 | pre .chunk, 110 | pre .winutils, 111 | pre .bash .variable, 112 | pre .apache .tag, 113 | pre .tex .special, 114 | pre .request, 115 | pre .status { 116 | font-weight: bold; 117 | } 118 | 119 | pre .coffeescript .javascript, 120 | pre .javascript .xml, 121 | pre .tex .formula, 122 | pre .xml .javascript, 123 | pre .xml .vbscript, 124 | pre .xml .css, 125 | pre .xml .cdata { 126 | opacity: 0.5; 127 | } 128 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/monokai_sublime.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Monokai Sublime style. Derived from Monokai by noformnocontent http://nn.mit-license.org/ 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; 9 | padding: 0.5em; 10 | background: #23241f; 11 | } 12 | pre .tag, 13 | pre code { 14 | color: #f8f8f2; 15 | } 16 | pre .keyword, 17 | pre .function, 18 | pre .literal, 19 | pre .change, 20 | pre .winutils, 21 | pre .flow, 22 | pre .lisp .title, 23 | pre .clojure .built_in, 24 | pre .nginx .title, 25 | pre .tex .special { 26 | color: #66d9ef; 27 | } 28 | pre .variable, 29 | pre .params { 30 | color: #fd9720; 31 | } 32 | pre .constant { 33 | color: #66d9ef; 34 | } 35 | pre .title, 36 | pre .class .title, 37 | pre .css .class { 38 | color: #a6e22e; 39 | } 40 | pre .attribute, 41 | pre .symbol, 42 | pre .symbol .string, 43 | pre .tag .title, 44 | pre .value, 45 | pre .css .tag { 46 | color: #f92672; 47 | } 48 | pre .number, 49 | pre .preprocessor, 50 | pre .pragma, 51 | pre .regexp { 52 | color: #ae81ff; 53 | } 54 | pre .tag .value, 55 | pre .string, 56 | pre .css .id, 57 | pre .subst, 58 | pre .haskell .type, 59 | pre .ruby .class .parent, 60 | pre .built_in, 61 | pre .sql .aggregate, 62 | pre .django .template_tag, 63 | pre .django .variable, 64 | pre .smalltalk .class, 65 | pre .django .filter .argument, 66 | pre .smalltalk .localvars, 67 | pre .smalltalk .array, 68 | pre .attr_selector, 69 | pre .pseudo, 70 | pre .addition, 71 | pre .stream, 72 | pre .envvar, 73 | pre .apache .tag, 74 | pre .apache .cbracket, 75 | pre .tex .command, 76 | pre .prompt { 77 | color: #e6db74; 78 | } 79 | pre .comment, 80 | pre .javadoc, 81 | pre .java .annotation, 82 | pre .python .decorator, 83 | pre .template_comment, 84 | pre .pi, 85 | pre .doctype, 86 | pre .deletion, 87 | pre .shebang, 88 | pre .apache .sqbracket, 89 | pre .tex .formula { 90 | color: #75715e; 91 | } 92 | pre .coffeescript .javascript, 93 | pre .javascript .xml, 94 | pre .tex .formula { 95 | opacity: 0.5; 96 | } 97 | pre .xml .javascript, 98 | pre .xml .vbscript, 99 | pre .xml .css, 100 | pre .xml .cdata { 101 | opacity: 0.5; 102 | } 103 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/obsidian.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Obsidian style 3 | * ported by Alexander Marenin (http://github.com/ioncreature) 4 | */ 5 | 6 | pre code { 7 | display: block; padding: 0.5em; 8 | background: #282B2E; 9 | } 10 | 11 | pre .keyword, 12 | pre .literal, 13 | pre .change, 14 | pre .winutils, 15 | pre .flow, 16 | pre .lisp .title, 17 | pre .clojure .built_in, 18 | pre .nginx .title, 19 | pre .css .id, 20 | pre .tex .special { 21 | color: #93C763; 22 | } 23 | 24 | pre .number { 25 | color: #FFCD22; 26 | } 27 | 28 | pre code { 29 | color: #E0E2E4; 30 | } 31 | 32 | pre .css .tag, 33 | pre .css .pseudo { 34 | color: #D0D2B5; 35 | } 36 | 37 | pre .attribute, 38 | pre code .constant { 39 | color: #668BB0; 40 | } 41 | 42 | pre .xml .attribute { 43 | color: #B3B689; 44 | } 45 | 46 | pre .xml .tag .value { 47 | color: #E8E2B7; 48 | } 49 | 50 | pre .code, 51 | pre .class .title, 52 | pre .header { 53 | color: white; 54 | } 55 | 56 | pre .class, 57 | pre .hexcolor { 58 | color: #93C763; 59 | } 60 | 61 | pre .regexp { 62 | color: #D39745; 63 | } 64 | 65 | pre .at_rule, 66 | pre .at_rule .keyword { 67 | color: #A082BD; 68 | } 69 | 70 | pre .doctype { 71 | color: #557182; 72 | } 73 | 74 | pre .link_url, 75 | pre .tag, 76 | pre .tag .title, 77 | pre .bullet, 78 | pre .subst, 79 | pre .emphasis, 80 | pre .haskell .type, 81 | pre .preprocessor, 82 | pre .pragma, 83 | pre .ruby .class .parent, 84 | pre .built_in, 85 | pre .sql .aggregate, 86 | pre .django .template_tag, 87 | pre .django .variable, 88 | pre .smalltalk .class, 89 | pre .javadoc, 90 | pre .django .filter .argument, 91 | pre .smalltalk .localvars, 92 | pre .smalltalk .array, 93 | pre .attr_selector, 94 | pre .pseudo, 95 | pre .addition, 96 | pre .stream, 97 | pre .envvar, 98 | pre .apache .tag, 99 | pre .apache .cbracket, 100 | pre .tex .command, 101 | pre .prompt { 102 | color: #8CBBAD; 103 | } 104 | 105 | pre .string { 106 | color: #EC7600; 107 | } 108 | 109 | pre .comment, 110 | pre .java .annotation, 111 | pre .blockquote, 112 | pre .horizontal_rule, 113 | pre .python .decorator, 114 | pre .template_comment, 115 | pre .pi, 116 | pre .deletion, 117 | pre .shebang, 118 | pre .apache .sqbracket, 119 | pre .tex .formula { 120 | color: #818E96; 121 | } 122 | 123 | pre .keyword, 124 | pre .literal, 125 | pre .css .id, 126 | pre .phpdoc, 127 | pre .title, 128 | pre .header, 129 | pre .haskell .type, 130 | pre .vbscript .built_in, 131 | pre .sql .aggregate, 132 | pre .rsl .built_in, 133 | pre .smalltalk .class, 134 | pre .diff .header, 135 | pre .chunk, 136 | pre .winutils, 137 | pre .bash .variable, 138 | pre .apache .tag, 139 | pre .tex .special, 140 | pre .request, 141 | pre .at_rule .keyword, 142 | pre .status { 143 | font-weight: bold; 144 | } 145 | 146 | pre .coffeescript .javascript, 147 | pre .javascript .xml, 148 | pre .tex .formula, 149 | pre .xml .javascript, 150 | pre .xml .vbscript, 151 | pre .xml .css, 152 | pre .xml .cdata { 153 | opacity: 0.5; 154 | } 155 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/pojoaque.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Pojoaque Style by Jason Tate 4 | http://web-cms-designs.com/ftopict-10-pojoaque-style-for-highlight-js-code-highlighter.html 5 | Based on Solarized Style from http://ethanschoonover.com/solarized 6 | 7 | */ 8 | 9 | pre code { 10 | display: block; padding: 0.5em; 11 | color: #DCCF8F; 12 | background: url(./pojoaque.jpg) repeat scroll left top #181914; 13 | } 14 | 15 | pre .comment, 16 | pre .template_comment, 17 | pre .diff .header, 18 | pre .doctype, 19 | pre .lisp .string, 20 | pre .javadoc { 21 | color: #586e75; 22 | font-style: italic; 23 | } 24 | 25 | pre .keyword, 26 | pre .css .rule .keyword, 27 | pre .winutils, 28 | pre .javascript .title, 29 | pre .method, 30 | pre .addition, 31 | pre .css .tag, 32 | pre .clojure .title, 33 | pre .nginx .title { 34 | color: #B64926; 35 | } 36 | 37 | pre .number, 38 | pre .command, 39 | pre .string, 40 | pre .tag .value, 41 | pre .phpdoc, 42 | pre .tex .formula, 43 | pre .regexp, 44 | pre .hexcolor { 45 | color: #468966; 46 | } 47 | 48 | pre .title, 49 | pre .localvars, 50 | pre .function .title, 51 | pre .chunk, 52 | pre .decorator, 53 | pre .built_in, 54 | pre .lisp .title, 55 | pre .clojure .built_in, 56 | pre .identifier, 57 | pre .id { 58 | color: #FFB03B; 59 | } 60 | 61 | pre .attribute, 62 | pre .variable, 63 | pre .lisp .body, 64 | pre .smalltalk .number, 65 | pre .constant, 66 | pre .class .title, 67 | pre .parent, 68 | pre .haskell .type { 69 | color: #b58900; 70 | } 71 | 72 | pre .css .attribute { 73 | color: #b89859; 74 | } 75 | 76 | pre .css .number,pre .css .hexcolor{ 77 | color: #DCCF8F; 78 | } 79 | 80 | pre .css .class { 81 | color: #d3a60c; 82 | } 83 | 84 | pre .preprocessor, 85 | pre .pragma, 86 | pre .pi, 87 | pre .shebang, 88 | pre .symbol, 89 | pre .symbol .string, 90 | pre .diff .change, 91 | pre .special, 92 | pre .attr_selector, 93 | pre .important, 94 | pre .subst, 95 | pre .cdata { 96 | color: #cb4b16; 97 | } 98 | 99 | pre .deletion { 100 | color: #dc322f; 101 | } 102 | 103 | pre .tex .formula { 104 | background: #073642; 105 | } 106 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/pojoaque.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/support/html/highlightjs/styles/pojoaque.jpg -------------------------------------------------------------------------------- /support/html/highlightjs/styles/railscasts.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Railscasts-like style (c) Visoft, Inc. (Damien White) 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; 9 | padding: 0.5em; 10 | background: #232323; 11 | color: #E6E1DC; 12 | } 13 | 14 | pre .comment, 15 | pre .template_comment, 16 | pre .javadoc, 17 | pre .shebang { 18 | color: #BC9458; 19 | font-style: italic; 20 | } 21 | 22 | pre .keyword, 23 | pre .ruby .function .keyword, 24 | pre .request, 25 | pre .status, 26 | pre .nginx .title, 27 | pre .method, 28 | pre .list .title { 29 | color: #C26230; 30 | } 31 | 32 | pre .string, 33 | pre .number, 34 | pre .regexp, 35 | pre .tag .value, 36 | pre .cdata, 37 | pre .filter .argument, 38 | pre .attr_selector, 39 | pre .apache .cbracket, 40 | pre .date, 41 | pre .tex .command, 42 | pre .markdown .link_label { 43 | color: #A5C261; 44 | } 45 | 46 | pre .subst { 47 | color: #519F50; 48 | } 49 | 50 | pre .tag, 51 | pre .tag .keyword, 52 | pre .tag .title, 53 | pre .doctype, 54 | pre .sub .identifier, 55 | pre .pi, 56 | pre .input_number { 57 | color: #E8BF6A; 58 | } 59 | 60 | pre .identifier { 61 | color: #D0D0FF; 62 | } 63 | 64 | pre .class .title, 65 | pre .haskell .type, 66 | pre .smalltalk .class, 67 | pre .javadoctag, 68 | pre .yardoctag, 69 | pre .phpdoc { 70 | text-decoration: none; 71 | } 72 | 73 | pre .constant { 74 | color: #DA4939; 75 | } 76 | 77 | 78 | pre .symbol, 79 | pre .built_in, 80 | pre .ruby .symbol .string, 81 | pre .ruby .symbol .identifier, 82 | pre .markdown .link_url, 83 | pre .attribute { 84 | color: #6D9CBE; 85 | } 86 | 87 | pre .markdown .link_url { 88 | text-decoration: underline; 89 | } 90 | 91 | 92 | 93 | pre .params, 94 | pre .variable, 95 | pre .clojure .attribute { 96 | color: #D0D0FF; 97 | } 98 | 99 | pre .css .tag, 100 | pre .rules .property, 101 | pre .pseudo, 102 | pre .tex .special { 103 | color: #CDA869; 104 | } 105 | 106 | pre .css .class { 107 | color: #9B703F; 108 | } 109 | 110 | pre .rules .keyword { 111 | color: #C5AF75; 112 | } 113 | 114 | pre .rules .value { 115 | color: #CF6A4C; 116 | } 117 | 118 | pre .css .id { 119 | color: #8B98AB; 120 | } 121 | 122 | pre .annotation, 123 | pre .apache .sqbracket, 124 | pre .nginx .built_in { 125 | color: #9B859D; 126 | } 127 | 128 | pre .preprocessor, 129 | pre .preprocessor * 130 | pre .pragma { 131 | color: #8996A8 !important; 132 | } 133 | 134 | pre .hexcolor, 135 | pre .css .value .number { 136 | color: #A5C261; 137 | } 138 | 139 | pre .title, 140 | pre .decorator, 141 | pre .css .function { 142 | color: #FFC66D; 143 | } 144 | 145 | pre .diff .header, 146 | pre .chunk { 147 | background-color: #2F33AB; 148 | color: #E6E1DC; 149 | display: inline-block; 150 | width: 100%; 151 | } 152 | 153 | pre .diff .change { 154 | background-color: #4A410D; 155 | color: #F8F8F8; 156 | display: inline-block; 157 | width: 100%; 158 | } 159 | 160 | pre .addition { 161 | background-color: #144212; 162 | color: #E6E1DC; 163 | display: inline-block; 164 | width: 100%; 165 | } 166 | 167 | pre .deletion { 168 | background-color: #600; 169 | color: #E6E1DC; 170 | display: inline-block; 171 | width: 100%; 172 | } 173 | 174 | pre .coffeescript .javascript, 175 | pre .javascript .xml, 176 | pre .tex .formula, 177 | pre .xml .javascript, 178 | pre .xml .vbscript, 179 | pre .xml .css, 180 | pre .xml .cdata { 181 | opacity: 0.7; 182 | } 183 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/rainbow.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Style with support for rainbow parens 4 | 5 | */ 6 | 7 | pre ::-moz-selection{ background: #FF5E99; color:#fff; text-shadow: none; } 8 | pre ::selection { background:#FF5E99; color:#fff; text-shadow: none; } 9 | 10 | pre code { 11 | display: block; padding: 0.5em; 12 | background: #474949; color: #D1D9E1; 13 | } 14 | 15 | 16 | pre .body, 17 | pre .collection { 18 | color: #D1D9E1; 19 | } 20 | 21 | pre .comment, 22 | pre .template_comment, 23 | pre .diff .header, 24 | pre .doctype, 25 | pre .lisp .string, 26 | pre .javadoc { 27 | color: #969896; 28 | font-style: italic; 29 | } 30 | 31 | pre .keyword, 32 | pre .clojure .attribute, 33 | pre .winutils, 34 | pre .javascript .title, 35 | pre .addition, 36 | pre .css .tag { 37 | color: #cc99cc; 38 | } 39 | 40 | pre .number { color: #f99157; } 41 | 42 | pre .command, 43 | pre .string, 44 | pre .tag .value, 45 | pre .phpdoc, 46 | pre .tex .formula, 47 | pre .regexp, 48 | pre .hexcolor { 49 | color: #8abeb7; 50 | } 51 | 52 | pre .title, 53 | pre .localvars, 54 | pre .function .title, 55 | pre .chunk, 56 | pre .decorator, 57 | pre .built_in, 58 | pre .lisp .title, 59 | pre .identifier 60 | { 61 | color: #b5bd68; 62 | } 63 | 64 | pre .class .keyword 65 | { 66 | color: #f2777a; 67 | } 68 | 69 | pre .variable, 70 | pre .lisp .body, 71 | pre .smalltalk .number, 72 | pre .constant, 73 | pre .class .title, 74 | pre .parent, 75 | pre .haskell .label, 76 | pre .id, 77 | pre .lisp .title, 78 | pre .clojure .title .built_in { 79 | color: #ffcc66; 80 | } 81 | 82 | pre .tag .title, 83 | pre .rules .property, 84 | pre .django .tag .keyword, 85 | pre .clojure .title .built_in { 86 | font-weight: bold; 87 | } 88 | 89 | pre .attribute, 90 | pre .clojure .title { 91 | color: #81a2be; 92 | } 93 | 94 | pre .preprocessor, 95 | pre .pragma, 96 | pre .pi, 97 | pre .shebang, 98 | pre .symbol, 99 | pre .symbol .string, 100 | pre .diff .change, 101 | pre .special, 102 | pre .attr_selector, 103 | pre .important, 104 | pre .subst, 105 | pre .cdata { 106 | color: #f99157; 107 | } 108 | 109 | pre .deletion { 110 | color: #dc322f; 111 | } 112 | 113 | pre .tex .formula { 114 | background: #eee8d5; 115 | } 116 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/school_book.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | School Book style from goldblog.com.ua (c) Zaripov Yura 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 15px 0.5em 0.5em 30px; 9 | font-size: 11px !important; 10 | line-height:16px !important; 11 | } 12 | 13 | pre{ 14 | background:#f6f6ae url(./school_book.png); 15 | border-top: solid 2px #d2e8b9; 16 | border-bottom: solid 1px #d2e8b9; 17 | } 18 | 19 | pre .keyword, 20 | pre .literal, 21 | pre .change, 22 | pre .winutils, 23 | pre .flow, 24 | pre .lisp .title, 25 | pre .clojure .built_in, 26 | pre .nginx .title, 27 | pre .tex .special { 28 | color:#005599; 29 | font-weight:bold; 30 | } 31 | 32 | pre code, 33 | pre .subst, 34 | pre .tag .keyword { 35 | color: #3E5915; 36 | } 37 | 38 | pre .string, 39 | pre .title, 40 | pre .haskell .type, 41 | pre .tag .value, 42 | pre .css .rules .value, 43 | pre .preprocessor, 44 | pre .pragma, 45 | pre .ruby .symbol, 46 | pre .ruby .symbol .string, 47 | pre .ruby .class .parent, 48 | pre .built_in, 49 | pre .sql .aggregate, 50 | pre .django .template_tag, 51 | pre .django .variable, 52 | pre .smalltalk .class, 53 | pre .javadoc, 54 | pre .ruby .string, 55 | pre .django .filter .argument, 56 | pre .smalltalk .localvars, 57 | pre .smalltalk .array, 58 | pre .attr_selector, 59 | pre .pseudo, 60 | pre .addition, 61 | pre .stream, 62 | pre .envvar, 63 | pre .apache .tag, 64 | pre .apache .cbracket, 65 | pre .nginx .built_in, 66 | pre .tex .command, 67 | pre .coffeescript .attribute { 68 | color: #2C009F; 69 | } 70 | 71 | pre .comment, 72 | pre .java .annotation, 73 | pre .python .decorator, 74 | pre .template_comment, 75 | pre .pi, 76 | pre .doctype, 77 | pre .deletion, 78 | pre .shebang, 79 | pre .apache .sqbracket { 80 | color: #E60415; 81 | } 82 | 83 | pre .keyword, 84 | pre .literal, 85 | pre .css .id, 86 | pre .phpdoc, 87 | pre .title, 88 | pre .haskell .type, 89 | pre .vbscript .built_in, 90 | pre .sql .aggregate, 91 | pre .rsl .built_in, 92 | pre .smalltalk .class, 93 | pre .xml .tag .title, 94 | pre .diff .header, 95 | pre .chunk, 96 | pre .winutils, 97 | pre .bash .variable, 98 | pre .apache .tag, 99 | pre .tex .command, 100 | pre .request, 101 | pre .status { 102 | font-weight: bold; 103 | } 104 | 105 | pre .coffeescript .javascript, 106 | pre .javascript .xml, 107 | pre .tex .formula, 108 | pre .xml .javascript, 109 | pre .xml .vbscript, 110 | pre .xml .css, 111 | pre .xml .cdata { 112 | opacity: 0.5; 113 | } 114 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/school_book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/support/html/highlightjs/styles/school_book.png -------------------------------------------------------------------------------- /support/html/highlightjs/styles/solarized_dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #002b36; color: #839496; 10 | } 11 | 12 | pre .comment, 13 | pre .template_comment, 14 | pre .diff .header, 15 | pre .doctype, 16 | pre .pi, 17 | pre .lisp .string, 18 | pre .javadoc { 19 | color: #586e75; 20 | font-style: italic; 21 | } 22 | 23 | pre .keyword, 24 | pre .winutils, 25 | pre .method, 26 | pre .addition, 27 | pre .css .tag, 28 | pre .request, 29 | pre .status, 30 | pre .nginx .title { 31 | color: #859900; 32 | } 33 | 34 | pre .number, 35 | pre .command, 36 | pre .string, 37 | pre .tag .value, 38 | pre .rules .value, 39 | pre .phpdoc, 40 | pre .tex .formula, 41 | pre .regexp, 42 | pre .hexcolor { 43 | color: #2aa198; 44 | } 45 | 46 | pre .title, 47 | pre .localvars, 48 | pre .chunk, 49 | pre .decorator, 50 | pre .built_in, 51 | pre .identifier, 52 | pre .vhdl .literal, 53 | pre .id, 54 | pre .css .function { 55 | color: #268bd2; 56 | } 57 | 58 | pre .attribute, 59 | pre .variable, 60 | pre .lisp .body, 61 | pre .smalltalk .number, 62 | pre .constant, 63 | pre .class .title, 64 | pre .parent, 65 | pre .haskell .type { 66 | color: #b58900; 67 | } 68 | 69 | pre .preprocessor, 70 | pre .preprocessor .keyword, 71 | pre .pragma, 72 | pre .shebang, 73 | pre .symbol, 74 | pre .symbol .string, 75 | pre .diff .change, 76 | pre .special, 77 | pre .attr_selector, 78 | pre .important, 79 | pre .subst, 80 | pre .cdata, 81 | pre .clojure .title, 82 | pre .css .pseudo { 83 | color: #cb4b16; 84 | } 85 | 86 | pre .deletion { 87 | color: #dc322f; 88 | } 89 | 90 | pre .tex .formula { 91 | background: #073642; 92 | } 93 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/solarized_light.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #fdf6e3; color: #657b83; 10 | } 11 | 12 | pre .comment, 13 | pre .template_comment, 14 | pre .diff .header, 15 | pre .doctype, 16 | pre .pi, 17 | pre .lisp .string, 18 | pre .javadoc { 19 | color: #93a1a1; 20 | font-style: italic; 21 | } 22 | 23 | pre .keyword, 24 | pre .winutils, 25 | pre .method, 26 | pre .addition, 27 | pre .css .tag, 28 | pre .request, 29 | pre .status, 30 | pre .nginx .title { 31 | color: #859900; 32 | } 33 | 34 | pre .number, 35 | pre .command, 36 | pre .string, 37 | pre .tag .value, 38 | pre .rules .value, 39 | pre .phpdoc, 40 | pre .tex .formula, 41 | pre .regexp, 42 | pre .hexcolor { 43 | color: #2aa198; 44 | } 45 | 46 | pre .title, 47 | pre .localvars, 48 | pre .chunk, 49 | pre .decorator, 50 | pre .built_in, 51 | pre .identifier, 52 | pre .vhdl .literal, 53 | pre .id, 54 | pre .css .function { 55 | color: #268bd2; 56 | } 57 | 58 | pre .attribute, 59 | pre .variable, 60 | pre .lisp .body, 61 | pre .smalltalk .number, 62 | pre .constant, 63 | pre .class .title, 64 | pre .parent, 65 | pre .haskell .type { 66 | color: #b58900; 67 | } 68 | 69 | pre .preprocessor, 70 | pre .preprocessor .keyword, 71 | pre .pragma, 72 | pre .shebang, 73 | pre .symbol, 74 | pre .symbol .string, 75 | pre .diff .change, 76 | pre .special, 77 | pre .attr_selector, 78 | pre .important, 79 | pre .subst, 80 | pre .cdata, 81 | pre .clojure .title, 82 | pre .css .pseudo { 83 | color: #cb4b16; 84 | } 85 | 86 | pre .deletion { 87 | color: #dc322f; 88 | } 89 | 90 | pre .tex .formula { 91 | background: #eee8d5; 92 | } 93 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/sunburst.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Sunburst-like style (c) Vasily Polovnyov 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #000; color: #f8f8f8; 10 | } 11 | 12 | pre .comment, 13 | pre .template_comment, 14 | pre .javadoc { 15 | color: #aeaeae; 16 | font-style: italic; 17 | } 18 | 19 | pre .keyword, 20 | pre .ruby .function .keyword, 21 | pre .request, 22 | pre .status, 23 | pre .nginx .title { 24 | color: #E28964; 25 | } 26 | 27 | pre .function .keyword, 28 | pre .sub .keyword, 29 | pre .method, 30 | pre .list .title { 31 | color: #99CF50; 32 | } 33 | 34 | pre .string, 35 | pre .tag .value, 36 | pre .cdata, 37 | pre .filter .argument, 38 | pre .attr_selector, 39 | pre .apache .cbracket, 40 | pre .date, 41 | pre .tex .command, 42 | pre .coffeescript .attribute { 43 | color: #65B042; 44 | } 45 | 46 | pre .subst { 47 | color: #DAEFA3; 48 | } 49 | 50 | pre .regexp { 51 | color: #E9C062; 52 | } 53 | 54 | pre .title, 55 | pre .sub .identifier, 56 | pre .pi, 57 | pre .tag, 58 | pre .tag .keyword, 59 | pre .decorator, 60 | pre .shebang, 61 | pre .prompt { 62 | color: #89BDFF; 63 | } 64 | 65 | pre .class .title, 66 | pre .haskell .type, 67 | pre .smalltalk .class, 68 | pre .javadoctag, 69 | pre .yardoctag, 70 | pre .phpdoc { 71 | text-decoration: underline; 72 | } 73 | 74 | pre .symbol, 75 | pre .ruby .symbol .string, 76 | pre .number { 77 | color: #3387CC; 78 | } 79 | 80 | pre .params, 81 | pre .variable, 82 | pre .clojure .attribute { 83 | color: #3E87E3; 84 | } 85 | 86 | pre .css .tag, 87 | pre .rules .property, 88 | pre .pseudo, 89 | pre .tex .special { 90 | color: #CDA869; 91 | } 92 | 93 | pre .css .class { 94 | color: #9B703F; 95 | } 96 | 97 | pre .rules .keyword { 98 | color: #C5AF75; 99 | } 100 | 101 | pre .rules .value { 102 | color: #CF6A4C; 103 | } 104 | 105 | pre .css .id { 106 | color: #8B98AB; 107 | } 108 | 109 | pre .annotation, 110 | pre .apache .sqbracket, 111 | pre .nginx .built_in { 112 | color: #9B859D; 113 | } 114 | 115 | pre .preprocessor, 116 | pre .pragma { 117 | color: #8996A8; 118 | } 119 | 120 | pre .hexcolor, 121 | pre .css .value .number { 122 | color: #DD7B3B; 123 | } 124 | 125 | pre .css .function { 126 | color: #DAD085; 127 | } 128 | 129 | pre .diff .header, 130 | pre .chunk, 131 | pre .tex .formula { 132 | background-color: #0E2231; 133 | color: #F8F8F8; 134 | font-style: italic; 135 | } 136 | 137 | pre .diff .change { 138 | background-color: #4A410D; 139 | color: #F8F8F8; 140 | } 141 | 142 | pre .addition { 143 | background-color: #253B22; 144 | color: #F8F8F8; 145 | } 146 | 147 | pre .deletion { 148 | background-color: #420E09; 149 | color: #F8F8F8; 150 | } 151 | 152 | pre .coffeescript .javascript, 153 | pre .javascript .xml, 154 | pre .tex .formula, 155 | pre .xml .javascript, 156 | pre .xml .vbscript, 157 | pre .xml .css, 158 | pre .xml .cdata { 159 | opacity: 0.5; 160 | } 161 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/tomorrow-night-blue.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Night Blue Theme */ 2 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 3 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 4 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 5 | .tomorrow-comment, pre .comment, pre .title { 6 | color: #7285b7; 7 | } 8 | 9 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { 10 | color: #ff9da4; 11 | } 12 | 13 | .tomorrow-orange, pre .number, pre .preprocessor, pre .pragma, pre .built_in, pre .literal, pre .params, pre .constant { 14 | color: #ffc58f; 15 | } 16 | 17 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute { 18 | color: #ffeead; 19 | } 20 | 21 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata { 22 | color: #d1f1a9; 23 | } 24 | 25 | .tomorrow-aqua, pre .css .hexcolor { 26 | color: #99ffff; 27 | } 28 | 29 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title { 30 | color: #bbdaff; 31 | } 32 | 33 | .tomorrow-purple, pre .keyword, pre .javascript .function { 34 | color: #ebbbff; 35 | } 36 | 37 | pre code { 38 | display: block; 39 | background: #002451; 40 | color: white; 41 | padding: 0.5em; 42 | } 43 | 44 | pre .coffeescript .javascript, 45 | pre .javascript .xml, 46 | pre .tex .formula, 47 | pre .xml .javascript, 48 | pre .xml .vbscript, 49 | pre .xml .css, 50 | pre .xml .cdata { 51 | opacity: 0.5; 52 | } 53 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/tomorrow-night-bright.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Night Bright Theme */ 2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 3 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 4 | .tomorrow-comment, pre .comment, pre .title { 5 | color: #969896; 6 | } 7 | 8 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { 9 | color: #d54e53; 10 | } 11 | 12 | .tomorrow-orange, pre .number, pre .preprocessor, pre .pragma, pre .built_in, pre .literal, pre .params, pre .constant { 13 | color: #e78c45; 14 | } 15 | 16 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute { 17 | color: #e7c547; 18 | } 19 | 20 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata { 21 | color: #b9ca4a; 22 | } 23 | 24 | .tomorrow-aqua, pre .css .hexcolor { 25 | color: #70c0b1; 26 | } 27 | 28 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title { 29 | color: #7aa6da; 30 | } 31 | 32 | .tomorrow-purple, pre .keyword, pre .javascript .function { 33 | color: #c397d8; 34 | } 35 | 36 | pre code { 37 | display: block; 38 | background: black; 39 | color: #eaeaea; 40 | padding: 0.5em; 41 | } 42 | 43 | pre .coffeescript .javascript, 44 | pre .javascript .xml, 45 | pre .tex .formula, 46 | pre .xml .javascript, 47 | pre .xml .vbscript, 48 | pre .xml .css, 49 | pre .xml .cdata { 50 | opacity: 0.5; 51 | } 52 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/tomorrow-night-eighties.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Night Eighties Theme */ 2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 3 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 4 | .tomorrow-comment, pre .comment, pre .title { 5 | color: #999999; 6 | } 7 | 8 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { 9 | color: #f2777a; 10 | } 11 | 12 | .tomorrow-orange, pre .number, pre .preprocessor, pre .pragma, pre .built_in, pre .literal, pre .params, pre .constant { 13 | color: #f99157; 14 | } 15 | 16 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute { 17 | color: #ffcc66; 18 | } 19 | 20 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata { 21 | color: #99cc99; 22 | } 23 | 24 | .tomorrow-aqua, pre .css .hexcolor { 25 | color: #66cccc; 26 | } 27 | 28 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title { 29 | color: #6699cc; 30 | } 31 | 32 | .tomorrow-purple, pre .keyword, pre .javascript .function { 33 | color: #cc99cc; 34 | } 35 | 36 | pre code { 37 | display: block; 38 | background: #2d2d2d; 39 | color: #cccccc; 40 | padding: 0.5em; 41 | } 42 | 43 | pre .coffeescript .javascript, 44 | pre .javascript .xml, 45 | pre .tex .formula, 46 | pre .xml .javascript, 47 | pre .xml .vbscript, 48 | pre .xml .css, 49 | pre .xml .cdata { 50 | opacity: 0.5; 51 | } 52 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/tomorrow-night.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Night Theme */ 2 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 3 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 4 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 5 | .tomorrow-comment, pre .comment, pre .title { 6 | color: #969896; 7 | } 8 | 9 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { 10 | color: #cc6666; 11 | } 12 | 13 | .tomorrow-orange, pre .number, pre .preprocessor, pre .pragma, pre .built_in, pre .literal, pre .params, pre .constant { 14 | color: #de935f; 15 | } 16 | 17 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute { 18 | color: #f0c674; 19 | } 20 | 21 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata { 22 | color: #b5bd68; 23 | } 24 | 25 | .tomorrow-aqua, pre .css .hexcolor { 26 | color: #8abeb7; 27 | } 28 | 29 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title { 30 | color: #81a2be; 31 | } 32 | 33 | .tomorrow-purple, pre .keyword, pre .javascript .function { 34 | color: #b294bb; 35 | } 36 | 37 | pre code { 38 | display: block; 39 | background: #1d1f21; 40 | color: #c5c8c6; 41 | padding: 0.5em; 42 | } 43 | 44 | pre .coffeescript .javascript, 45 | pre .javascript .xml, 46 | pre .tex .formula, 47 | pre .xml .javascript, 48 | pre .xml .vbscript, 49 | pre .xml .css, 50 | pre .xml .cdata { 51 | opacity: 0.5; 52 | } 53 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/tomorrow.css: -------------------------------------------------------------------------------- 1 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 2 | .tomorrow-comment, pre .comment, pre .title { 3 | color: #8e908c; 4 | } 5 | 6 | .tomorrow-red, pre .variable, pre .attribute, pre .tag, pre .regexp, pre .ruby .constant, pre .xml .tag .title, pre .xml .pi, pre .xml .doctype, pre .html .doctype, pre .css .id, pre .css .class, pre .css .pseudo { 7 | color: #c82829; 8 | } 9 | 10 | .tomorrow-orange, pre .number, pre .preprocessor, pre .pragma, pre .built_in, pre .literal, pre .params, pre .constant { 11 | color: #f5871f; 12 | } 13 | 14 | .tomorrow-yellow, pre .ruby .class .title, pre .css .rules .attribute { 15 | color: #eab700; 16 | } 17 | 18 | .tomorrow-green, pre .string, pre .value, pre .inheritance, pre .header, pre .ruby .symbol, pre .xml .cdata { 19 | color: #718c00; 20 | } 21 | 22 | .tomorrow-aqua, pre .css .hexcolor { 23 | color: #3e999f; 24 | } 25 | 26 | .tomorrow-blue, pre .function, pre .python .decorator, pre .python .title, pre .ruby .function .title, pre .ruby .title .keyword, pre .perl .sub, pre .javascript .title, pre .coffeescript .title { 27 | color: #4271ae; 28 | } 29 | 30 | .tomorrow-purple, pre .keyword, pre .javascript .function { 31 | color: #8959a8; 32 | } 33 | 34 | pre code { 35 | display: block; 36 | background: white; 37 | color: #4d4d4c; 38 | padding: 0.5em; 39 | } 40 | 41 | pre .coffeescript .javascript, 42 | pre .javascript .xml, 43 | pre .tex .formula, 44 | pre .xml .javascript, 45 | pre .xml .vbscript, 46 | pre .xml .css, 47 | pre .xml .cdata { 48 | opacity: 0.5; 49 | } 50 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/vs.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Visual Studio-like style based on original C# coloring by Jason Diamond 4 | 5 | */ 6 | pre code { 7 | display: block; padding: 0.5em; 8 | background: white; color: black; 9 | } 10 | 11 | pre .comment, 12 | pre .annotation, 13 | pre .template_comment, 14 | pre .diff .header, 15 | pre .chunk, 16 | pre .apache .cbracket { 17 | color: rgb(0, 128, 0); 18 | } 19 | 20 | pre .keyword, 21 | pre .id, 22 | pre .built_in, 23 | pre .smalltalk .class, 24 | pre .winutils, 25 | pre .bash .variable, 26 | pre .tex .command, 27 | pre .request, 28 | pre .status, 29 | pre .nginx .title, 30 | pre .xml .tag, 31 | pre .xml .tag .value { 32 | color: rgb(0, 0, 255); 33 | } 34 | 35 | pre .string, 36 | pre .title, 37 | pre .parent, 38 | pre .tag .value, 39 | pre .rules .value, 40 | pre .rules .value .number, 41 | pre .ruby .symbol, 42 | pre .ruby .symbol .string, 43 | pre .aggregate, 44 | pre .template_tag, 45 | pre .django .variable, 46 | pre .addition, 47 | pre .flow, 48 | pre .stream, 49 | pre .apache .tag, 50 | pre .date, 51 | pre .tex .formula, 52 | pre .coffeescript .attribute { 53 | color: rgb(163, 21, 21); 54 | } 55 | 56 | pre .ruby .string, 57 | pre .decorator, 58 | pre .filter .argument, 59 | pre .localvars, 60 | pre .array, 61 | pre .attr_selector, 62 | pre .pseudo, 63 | pre .pi, 64 | pre .doctype, 65 | pre .deletion, 66 | pre .envvar, 67 | pre .shebang, 68 | pre .preprocessor, 69 | pre .pragma, 70 | pre .userType, 71 | pre .apache .sqbracket, 72 | pre .nginx .built_in, 73 | pre .tex .special, 74 | pre .prompt { 75 | color: rgb(43, 145, 175); 76 | } 77 | 78 | pre .phpdoc, 79 | pre .javadoc, 80 | pre .xmlDocTag { 81 | color: rgb(128, 128, 128); 82 | } 83 | 84 | pre .vhdl .typename { font-weight: bold; } 85 | pre .vhdl .string { color: #666666; } 86 | pre .vhdl .literal { color: rgb(163, 21, 21); } 87 | pre .vhdl .attribute { color: #00B0E8; } 88 | 89 | pre .xml .attribute { color: rgb(255, 0, 0); } 90 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/xcode.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | XCode style (c) Angel Garcia 4 | 5 | */ 6 | 7 | pre code { 8 | display: block; padding: 0.5em; 9 | background: #fff; color: black; 10 | } 11 | 12 | pre .comment, 13 | pre .template_comment, 14 | pre .javadoc, 15 | pre .comment * { 16 | color: rgb(0,106,0); 17 | } 18 | 19 | pre .keyword, 20 | pre .literal, 21 | pre .nginx .title { 22 | color: rgb(170,13,145); 23 | } 24 | pre .method, 25 | pre .list .title, 26 | pre .tag .title, 27 | pre .setting .value, 28 | pre .winutils, 29 | pre .tex .command, 30 | pre .http .title, 31 | pre .request, 32 | pre .status { 33 | color: #008; 34 | } 35 | 36 | pre .envvar, 37 | pre .tex .special { 38 | color: #660; 39 | } 40 | 41 | pre .string { 42 | color: rgb(196,26,22); 43 | } 44 | pre .tag .value, 45 | pre .cdata, 46 | pre .filter .argument, 47 | pre .attr_selector, 48 | pre .apache .cbracket, 49 | pre .date, 50 | pre .regexp { 51 | color: #080; 52 | } 53 | 54 | pre .sub .identifier, 55 | pre .pi, 56 | pre .tag, 57 | pre .tag .keyword, 58 | pre .decorator, 59 | pre .ini .title, 60 | pre .shebang, 61 | pre .prompt, 62 | pre .hexcolor, 63 | pre .rules .value, 64 | pre .css .value .number, 65 | pre .symbol, 66 | pre .symbol .string, 67 | pre .number, 68 | pre .css .function, 69 | pre .clojure .title, 70 | pre .clojure .built_in, 71 | pre .function .title, 72 | pre .coffeescript .attribute { 73 | color: rgb(28,0,207); 74 | } 75 | 76 | pre .class .title, 77 | pre .haskell .type, 78 | pre .smalltalk .class, 79 | pre .javadoctag, 80 | pre .yardoctag, 81 | pre .phpdoc, 82 | pre .typename, 83 | pre .tag .attribute, 84 | pre .doctype, 85 | pre .class .id, 86 | pre .built_in, 87 | pre .setting, 88 | pre .params, 89 | pre .clojure .attribute { 90 | color: rgb(92,38,153); 91 | } 92 | 93 | pre .variable { 94 | color: rgb(63,110,116); 95 | } 96 | pre .css .tag, 97 | pre .rules .property, 98 | pre .pseudo, 99 | pre .subst { 100 | color: #000; 101 | } 102 | 103 | pre .css .class, pre .css .id { 104 | color: #9B703F; 105 | } 106 | 107 | pre .value .important { 108 | color: #ff7700; 109 | font-weight: bold; 110 | } 111 | 112 | pre .rules .keyword { 113 | color: #C5AF75; 114 | } 115 | 116 | pre .annotation, 117 | pre .apache .sqbracket, 118 | pre .nginx .built_in { 119 | color: #9B859D; 120 | } 121 | 122 | pre .preprocessor, 123 | pre .preprocessor *, 124 | pre .pragma { 125 | color: rgb(100,56,32); 126 | } 127 | 128 | pre .tex .formula { 129 | background-color: #EEE; 130 | font-style: italic; 131 | } 132 | 133 | pre .diff .header, 134 | pre .chunk { 135 | color: #808080; 136 | font-weight: bold; 137 | } 138 | 139 | pre .diff .change { 140 | background-color: #BCCFF9; 141 | } 142 | 143 | pre .addition { 144 | background-color: #BAEEBA; 145 | } 146 | 147 | pre .deletion { 148 | background-color: #FFC8BD; 149 | } 150 | 151 | pre .comment .yardoctag { 152 | font-weight: bold; 153 | } 154 | 155 | pre .method .id { 156 | color: #000; 157 | } 158 | -------------------------------------------------------------------------------- /support/html/highlightjs/styles/zenburn.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Zenburn style from voldmar.ru (c) Vladimir Epifanov 4 | based on dark.css by Ivan Sagalaev 5 | 6 | */ 7 | 8 | pre code { 9 | display: block; padding: 0.5em; 10 | background: #3F3F3F; 11 | color: #DCDCDC; 12 | } 13 | 14 | pre .keyword, 15 | pre .tag, 16 | pre .css .class, 17 | pre .css .id, 18 | pre .lisp .title, 19 | pre .nginx .title, 20 | pre .request, 21 | pre .status, 22 | pre .clojure .attribute { 23 | color: #E3CEAB; 24 | } 25 | 26 | pre .django .template_tag, 27 | pre .django .variable, 28 | pre .django .filter .argument { 29 | color: #DCDCDC; 30 | } 31 | 32 | pre .number, 33 | pre .date { 34 | color: #8CD0D3; 35 | } 36 | 37 | pre .dos .envvar, 38 | pre .dos .stream, 39 | pre .variable, 40 | pre .apache .sqbracket { 41 | color: #EFDCBC; 42 | } 43 | 44 | pre .dos .flow, 45 | pre .diff .change, 46 | pre .python .exception, 47 | pre .python .built_in, 48 | pre .literal, 49 | pre .tex .special { 50 | color: #EFEFAF; 51 | } 52 | 53 | pre .diff .chunk, 54 | pre .subst { 55 | color: #8F8F8F; 56 | } 57 | 58 | pre .dos .keyword, 59 | pre .python .decorator, 60 | pre .title, 61 | pre .haskell .type, 62 | pre .diff .header, 63 | pre .ruby .class .parent, 64 | pre .apache .tag, 65 | pre .nginx .built_in, 66 | pre .tex .command, 67 | pre .prompt { 68 | color: #efef8f; 69 | } 70 | 71 | pre .dos .winutils, 72 | pre .ruby .symbol, 73 | pre .ruby .symbol .string, 74 | pre .ruby .string { 75 | color: #DCA3A3; 76 | } 77 | 78 | pre .diff .deletion, 79 | pre .string, 80 | pre .tag .value, 81 | pre .preprocessor, 82 | pre .pragma, 83 | pre .built_in, 84 | pre .sql .aggregate, 85 | pre .javadoc, 86 | pre .smalltalk .class, 87 | pre .smalltalk .localvars, 88 | pre .smalltalk .array, 89 | pre .css .rules .value, 90 | pre .attr_selector, 91 | pre .pseudo, 92 | pre .apache .cbracket, 93 | pre .tex .formula, 94 | pre .coffeescript .attribute { 95 | color: #CC9393; 96 | } 97 | 98 | pre .shebang, 99 | pre .diff .addition, 100 | pre .comment, 101 | pre .java .annotation, 102 | pre .template_comment, 103 | pre .pi, 104 | pre .doctype { 105 | color: #7F9F7F; 106 | } 107 | 108 | pre .coffeescript .javascript, 109 | pre .javascript .xml, 110 | pre .tex .formula, 111 | pre .xml .javascript, 112 | pre .xml .vbscript, 113 | pre .xml .css, 114 | pre .xml .cdata { 115 | opacity: 0.5; 116 | } 117 | 118 | -------------------------------------------------------------------------------- /support/html/js/annotated-paragraphs.js: -------------------------------------------------------------------------------- 1 | function transformAnnotatedParagraphs(pClass, pTitle) { 2 | $("p." + pClass).wrap( "
" ).prepend("

"+ pTitle +"

"); 4 | } 5 | 6 | transformAnnotatedParagraphs("note", "Note"); 7 | transformAnnotatedParagraphs("todo", "To do"); 8 | -------------------------------------------------------------------------------- /support/html/js/highlight-commands.js: -------------------------------------------------------------------------------- 1 | /* Extends highligh.js for shell commands alternating with program output.. 2 | * Cmmands are single line and must be marked with a prompt sign (a dollar 3 | * sign). 4 | * 5 | * Disclaimer: this is implemented as a monkey-patch over highlight.pack.js so 6 | * it uses the short illegible key names (c, cN…). See their build tool: 7 | * https://github.com/isagalaev/highlight.js/blob/master/tools/build.py 8 | */ 9 | hljs.LANGUAGES.shellcommands = (function (it) { 10 | "use strict"; 11 | var prompt_re = /^\$\ /; 12 | return { 13 | c: [{ 14 | cN: "prompt", 15 | b: prompt_re, 16 | starts: { e: /$/, sL: "bash" } 17 | }, { cN: "output", b: /^[^$]/, e: prompt_re, rE: true }] 18 | }; 19 | }(hljs)); 20 | -------------------------------------------------------------------------------- /support/latex/common.tex: -------------------------------------------------------------------------------- 1 | \pagelayout{\paperbackpage} 2 | 3 | \usepackage{root/support/latex/sbabook/pharo-titlepage} 4 | 5 | \usepackage{polyglossia} 6 | \usepackage[useregional]{datetime2} 7 | 8 | % extract info from git commit 9 | % requires gitinfo2 2.0.7, and below fix needed until 2.0.8 released 10 | \makeatletter 11 | \let\THEDAY\@dtm@currentday 12 | \let\THEMONTH\@dtm@currentmonth 13 | \let\THEYEAR\@dtm@currentyear 14 | \makeatother 15 | \usepackage[local,missing=!,dirty=*]{gitinfo2} 16 | \usepackage{xstring}% \IfEq and \StrCut 17 | % a couple extensions... 18 | \makeatletter 19 | \newcommand\gitCommitInfo{% 20 | \IfEq{\gitRel}{} 21 | {\IfEq{\gitAbbrevHash}{!}% same as missing package option 22 | {}% no versioning info => no noise 23 | {\gitBranch\,@\,\texttt{\gitAbbrevHash\gitDirty}}} 24 | {\IfEq{\gitRoff}{0} 25 | {release \gitRel} 26 | {modified since \gitRel{} --- \gitBranch\,@\,\texttt{\gitAbbrevHash\gitDirty}}}} 27 | \newcommand\gitdate{\DTMusedate{gitdate}} 28 | \makeatother 29 | 30 | \usepackage[normalem]{ulem} % for strikeout text (\sout{...}) 31 | \usepackage{graphicx} 32 | 33 | \usepackage{url} % define and apply style to URLs 34 | \def\url@sfstyle{\def\UrlFont{\sf}} 35 | \urlstyle{sf} 36 | \usepackage[ 37 | unicode, 38 | breaklinks, hidelinks, % undecorated hyperlinks 39 | bookmarks, bookmarksdepth = subsubsection 40 | ]{hyperref} 41 | 42 | % Lulu only supports PDF format version 1.3 43 | \pdfminorversion=3 44 | 45 | \usepackage{multicol} 46 | \usepackage{multirow} 47 | 48 | % a nice horizontal separator 49 | \newcommand{\sectionline}{% 50 | \begin{center}\nointerlineskip 51 | \rule{0.233\linewidth}{.7pt}% 52 | \end{center} 53 | } 54 | 55 | % less space around lists 56 | \tightlists 57 | 58 | % showing code, inline and as blocks 59 | \usepackage{lstsmalltalk} 60 | \usepackage{lsthttp} 61 | \lstdefinelanguage{plain}{}% verbatim, plain text 62 | 63 | \lstalias{Pillar}{plain} 64 | \lstalias{CSS}{plain} 65 | \lstalias{JSON}{plain} 66 | \lstalias{STON}{plain} 67 | \lstalias{Javascript}{plain} 68 | \lstalias{ShellCommands}{plain} 69 | 70 | \lstset{ 71 | language = smalltalk, 72 | tabsize = 3 73 | } 74 | 75 | % highlighted paragraphs 76 | \newenvironment{note}{% 77 | \begin{leftbar}\textsf{\textbf{Note}}\quad 78 | }{\end{leftbar}} 79 | 80 | \newenvironment{todo}{% 81 | \begin{leftbar}\textsf{\textbf{To do}}\quad 82 | }{\end{leftbar}} 83 | -------------------------------------------------------------------------------- /support/latex/lsthttp.sty: -------------------------------------------------------------------------------- 1 | \ProvidesFile{lsthttp.sty} 2 | [2015/09/23 0.1 listings HTTP definitions file] 3 | % 4 | \RequirePackage{listings}% 5 | 6 | \lstdefinelanguage{HTTP}{ 7 | keywords={% requests 8 | GET, POST, PUT, DELETE, HEAD, 9 | TRACE, CONNECT, OPTIONS, PATCH, 10 | HTTP, OK 11 | }, 12 | morecomment=[l]{:} 13 | }% 14 | \endinput -------------------------------------------------------------------------------- /support/latex/lstsmalltalk.sty: -------------------------------------------------------------------------------- 1 | \ProvidesFile{lstsmalltalk.sty} 2 | [2009/07/03 0.2 listings Smalltalk definitions file] 3 | % 4 | \RequirePackage{listings}% 5 | 6 | \lstdefinelanguage{Smalltalk}{ 7 | keywords={self,super,true,false,nil,thisContext}, 8 | otherkeywords={^,:=,->,==,~=}, 9 | alsoletter={\#:}, 10 | string=[d]', 11 | comment=[s]{"}{"}, 12 | }[keywords,comments,strings]% 13 | \endinput 14 | %%% 15 | %%% And now for something completely different... Some stupid example, 16 | %%% to put in a file to test this language definition... 17 | %%% 18 | % \lstset{ 19 | % inputencoding=utf8, 20 | % columns=fullflexible, 21 | % basicstyle=\Large 22 | % } 23 | % 24 | % \begin{lstlisting}[language=Smalltalk] 25 | % SomeClass >> testNumberOfRelationships 26 | % "this is a test" 27 | % | bazEntity | 28 | % self assert: fooEntity numberOfOutgoingRelationships = 1. 29 | % bazEntity := MyEntity named: #baz. 30 | % MyRelationship from: fooEntity to: bazEntity. 31 | % self assert: fooEntity numberOfOutgoingRelationships = 2. 32 | % string := 'Hello, world!' 33 | % aCollection do: [ each | 34 | % | local | 35 | % each someMessage ]. 36 | % ^ string 37 | % \end{lstlisting} 38 | %%%%%%%% 39 | % Local Variables: 40 | % coding: utf-8 41 | % End: 42 | -------------------------------------------------------------------------------- /support/latex/overcolored.sty: -------------------------------------------------------------------------------- 1 | %% 2 | %% This is file `overcolored.sty', 3 | %% generated with the docstrip utility. 4 | %% 5 | %% The original source files were: 6 | %% 7 | %% overcolored.dtx (with options: `package') 8 | %% 9 | %% This is a generated file. 10 | %% 11 | %% Copyright (C) 2011-2012 by Raphaël Pinson 12 | %% -------------------------------------------------------------------------- 13 | %% This work may be distributed and/or modified under the 14 | %% conditions of the LaTeX Project Public License, either version 1.3 15 | %% of this license or (at your option) any later version. 16 | %% The latest version of this license is in 17 | %% http://www.latex-project.org/lppl.txt 18 | %% and version 1.3 or later is part of all distributions of LaTeX 19 | %% version 2005/12/01 or later. 20 | %% 21 | \NeedsTeXFormat{LaTeX2e}[1999/12/01] 22 | \ProvidesPackage{overcolored} 23 | [2011/09/15 0.1 Typeset colored overfull rules] 24 | \ProvidesPackage{overcolored} 25 | \RequirePackage{xcolor} 26 | \RequirePackage{kvoptions} 27 | \RequirePackage{ifluatex} 28 | \SetupKeyvalOptions{ 29 | family=overcolored, 30 | prefix=overcolored@, 31 | } 32 | \DeclareStringOption[magenta]{color} 33 | \DeclareStringOption[0.5em]{width} 34 | \DeclareStringOption[3ex]{height} 35 | \ProcessKeyvalOptions* 36 | \def\overcoloredboxtex{% 37 | \hbox to\wd0{% 38 | \setbox0=\hbox to\wd0{\unhbox0}% 39 | \unhbox0 \ifnum\badness>10000 \smash{% 40 | \rlap{\color{\overcolored@color}{% 41 | \rule{\overcolored@width}{\overcolored@height}}}}% 42 | \fi% 43 | }% 44 | } 45 | \def\overuncoloredtex{% 46 | \let\output=\orioutput 47 | } 48 | \ifluatex 49 | \RequirePackage{luatexbase,luacode} 50 | \overfullrule \overcolored@width 51 | \begin{luacode} 52 | magentabox = function(head) 53 | while head do 54 | if head.id == 0 or head.id == 1 then 55 | -- go through the hlists (the rows) 56 | magentabox(head.head) 57 | 58 | -- if there's a rule after the rightskip, this is the overfull box 59 | -- node id 10 == glue, glue subtype 9 is rightskip, node id 2 is a rule 60 | 61 | elseif head.id == 10 and head.subtype == 9 and head.next and head.next.id == 2 then 62 | -- this must be an overfull box 63 | local w1, w2 64 | w1 = node.new("whatsit","pdf_literal") 65 | w1.data = "q 1 0 1 rg" 66 | w1.mode = 1 67 | w2 = node.new("whatsit","pdf_literal") 68 | w2.data = " Q" 69 | w2.mode = 1 70 | 71 | w1.next = head.next -- the rule 72 | head.next = w1 -- color start 73 | w1.next.next = w2 -- color end 74 | 75 | node.slide(head) -- adjust prev pointers 76 | end 77 | head = head.next 78 | end 79 | return true 80 | end 81 | luatexbase.add_to_callback("post_linebreak_filter",magentabox,"magentabox") 82 | \end{luacode} 83 | \else 84 | \interlinepenalty=-50000 % force the break between each two lines 85 | \maxdeadcycles=50 % allow upto 50 \outputs with no \shipout 86 | \newtoks\orioutput \orioutput=\output % wrap the original \output routine 87 | \output 88 | {\ifnum\outputpenalty>-20000 \the\orioutput 89 | \else \ifnum\outputpenalty<-\maxdimen \the\orioutput 90 | \else 91 | \unvbox255 % flush the entire list back 92 | \setbox0=\lastbox % strip the very last box 93 | \nointerlineskip % avoid doubled interline glue 94 | \overcoloredboxtex % make the test and return the box back. 95 | \advance\outputpenalty by50000 96 | \penalty\outputpenalty % weak lie that nothing happened... 97 | \fi\fi} 98 | \fi 99 | \def\overuncolored{% 100 | \ifluatex 101 | \PackageError{overuncolored is not implemented for LuaTeX} 102 | \else 103 | \overuncoloredtex 104 | \fi 105 | } 106 | \endinput 107 | %% 108 | %% End of file `overcolored.sty'. 109 | -------------------------------------------------------------------------------- /support/latex/sbabook/.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.fdb_latexmk 3 | *.fls 4 | *.gin 5 | *.lof 6 | *.log 7 | *.lol 8 | *.lot 9 | *.toc 10 | .auctex/ 11 | /auto/ 12 | sbabook*.pdf 13 | -------------------------------------------------------------------------------- /support/latex/sbabook/.gitrepo: -------------------------------------------------------------------------------- 1 | ; DO NOT EDIT (unless you know what you are doing) 2 | ; 3 | ; This subdirectory is a git "subrepo", and this file is maintained by the 4 | ; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme 5 | ; 6 | [subrepo] 7 | remote = git@github.com:cdlm/sbabook.git 8 | branch = master 9 | commit = 5184785c31cb037f81c57e9f0bbadffb20d3b461 10 | parent = fcb06df3e49fedaaff9f59430dbaf8943e4c2535 11 | cmdver = 0.3.1 12 | -------------------------------------------------------------------------------- /support/latex/sbabook/.latexmkrc: -------------------------------------------------------------------------------- 1 | # -*- mode: perl; -*- 2 | $pdflatex = 'lualatex --file-line-error %O %S'; 3 | $pdf_mode = 1; 4 | 5 | # extract git version info before each compile 6 | system('./gitinfo2.sh > gitHeadLocal.gin'); 7 | 8 | @default_files = ( 'sbabook' ); 9 | -------------------------------------------------------------------------------- /support/latex/sbabook/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | services: 3 | - docker 4 | 5 | before_install: 6 | - docker pull dpollet/texlive 7 | 8 | script: 9 | - docker run --tty --rm --volume $PWD:/work dpollet/texlive:base latexmk 10 | 11 | deploy: 12 | provider: releases 13 | api_key: 14 | secure: 0VV/C2lRToLm/PzZd4tVWOGGVjgRi11nj4VRw/D93Y1XTy2IWoyctWg/02OpZ+vzmMjT9dk/V2ZyfsYZT/dTSVT2HVPW8n4HSlBDqHhVaEGEKEd2YxLw/V1yVehco16gAtaDAFCZITW2Kod9hiIRoRTcInkCyT4zKrco6v7XmSY= 15 | skip_cleanup: true 16 | file: sbabook.pdf 17 | on: 18 | tags: true 19 | -------------------------------------------------------------------------------- /support/latex/sbabook/CreativeCommons-BY-SA.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/support/latex/sbabook/CreativeCommons-BY-SA.pdf -------------------------------------------------------------------------------- /support/latex/sbabook/README.markdown: -------------------------------------------------------------------------------- 1 | SBAbook — A LaTeX class for technical books 2 | =========================================== 3 | 4 | This is a set of layout, typography, and markup definitions for LaTeX books based on the [memoir][] document class. 5 | It is intended for use by [Square Bracket Associates (SBA)][sba], and heavily customized in this direction — by this I mean it's made to setup specific semantic markup and typographic style, rather than to be flexible. 6 | 7 | [![Build Status](https://travis-ci.org/cdlm/sbabook.svg?branch=master)](https://travis-ci.org/cdlm/sbabook) 8 | [![Flattr this git repo](https://button.flattr.com/flattr-badge-large.png)](https://flattr.com/submit/auto?url=https%3A%2F%2Fgithub.com%2Fcdlm%2Fsbabook) 9 | 10 | 11 | ## Usage (nearly there) 12 | 13 | The preamble is limited to the minimum: 14 | 15 | ```latex 16 | \documentclass{sbabook} 17 | \setmainlanguage{english} % this is polyglossia, not babel 18 | \begin{document} 19 | 20 | ...and off you go! 21 | 22 | \end{document} 23 | ``` 24 | 25 | The class requires LuaLaTeX to load nice fonts; just use `lualatex` instead of `pdflatex` to compile. 26 | 27 | 28 | ## Showcase 29 | 30 | It looks nice, I promise! 31 | Check the [manual / example file](https://github.com/cdlm/sbabook/blob/master/sbabook.tex); a compiled version is attached to the [latest release](https://github.com/cdlm/sbabook/releases/latest/). 32 | 33 | 34 | ## Install 35 | 36 | Clone or otherwise download the contents of this repo, and put the files somewhere LaTeX can find them. 37 | Run `kpsexpand '$TEXMFHOME'` for a suggestion. 38 | 39 | 40 | ## Requirements 41 | 42 | You need a pretty up-to-date and complete LaTeX distribution, because the class requires LuaLaTeX and some associated packages to compile. 43 | Just get a full install of the latest [TeXlive release][tl] and you should be good. 44 | 45 | Fonts: the class uses [Gentium Book Basic][gentium], [Open Sans][], and [Fira mono][fira]. 46 | Those are now distributed as part of TeXlive. 47 | 48 | On Linux distributions that maintain their own packaging instead of using the system provided by TeXlive, you will probably need to install several packages; e.g. on Ubuntu 15.04, since `texlive-full` doesn't seem to be a full install, you will additionally need: 49 | - `texlive-luatex`, for `luaotfload.sty`, 50 | - `texlive-xetex`, for `xunicode.sty`, 51 | - `texlive-generic-extra`, for `tracklang.sty`, 52 | - `texlive-fonts-extra`, for the Gentium fonts… 53 | 54 | [memoir]: http://www.ctan.org/pkg/memoir 55 | [sba]: https://github.com/SquareBracketAssociates 56 | [tl]: http://www.tug.org/texlive/acquire-netinstall.html 57 | [gentium]: http://www.google.com/webfonts/specimen/Gentium+Book+Basic 58 | [open sans]: http://www.google.com/webfonts/specimen/Open+Sans 59 | [fira]: https://mozilla.github.io/Fira/ 60 | [inconsolata]: http://www.google.com/webfonts/specimen/Inconsolata 61 | -------------------------------------------------------------------------------- /support/latex/sbabook/TODO.markdown: -------------------------------------------------------------------------------- 1 | Things left to implement or fix 2 | =============================== 3 | 4 | - whole book / per chapter compilation 5 | - book/part title pages 6 | - colophon, foreword... 7 | - hint paragraphs with fontawesome icons (or floats) 8 | - check with LuLu about Distiller b0rking ligatures and vector illustrations 9 | - normal floats for listings: normal label/caption, and use displaycode 10 | environments inside. This would enable to group several small listings in 11 | succession under a single caption, e.g. related Smalltalk methods… 12 | -------------------------------------------------------------------------------- /support/latex/sbabook/gitinfo2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Extract version info for use by the gitinfo2.sty package. 4 | # 5 | # Modified from gitinfo2's post-xxx-sample.txt file, to make it callable from 6 | # the build system instead of as a git hook, and to make it robust outside of a 7 | # git checkout. 8 | 9 | # strict error handling 10 | set -o pipefail # trace ERR through pipes 11 | set -o errtrace # trace ERR through 'time command' and other functions 12 | set -o nounset # set -u : exit the script if you try to use an uninitialized variable 13 | set -o errexit # set -e : exit the script if any statement returns a non-true return value 14 | 15 | function die() { 16 | status="$1"; shift 17 | echo "$0: ${*:-Error extracting version info}" >&2 18 | exit "$status" 19 | } 20 | 21 | function silently() { 22 | "$@" > /dev/null 2>&1 23 | } 24 | 25 | # Check that we're in a git repo with a proper HEAD commit, or bail out 26 | silently git rev-parse --is-inside-work-tree || die 0 "Not in a git repo" 27 | silently git rev-parse --verify HEAD || die 0 "No parent commit available" 28 | 29 | # Get the first tag found in the history from the current HEAD 30 | FIRSTTAG=$(git describe --tags --always --dirty='-*' 2>/dev/null) 31 | # Get the first tag in history that looks like a Release 32 | RELTAG=$(git describe --tags --long --always --dirty='-*' --match '[0-9]*.*' 2>/dev/null) 33 | # Format git info as a LaTeX package load 34 | FMT="\ 35 | \usepackage[% 36 | shash={%h}, 37 | lhash={%H}, 38 | authname={%an}, 39 | authemail={%ae}, 40 | authsdate={%ad}, 41 | authidate={%ai}, 42 | authudate={%at}, 43 | commname={%an}, 44 | commemail={%ae}, 45 | commsdate={%ad}, 46 | commidate={%ai}, 47 | commudate={%at}, 48 | refnames={%d}, 49 | firsttagdescribe={$FIRSTTAG}, 50 | reltag={$RELTAG} 51 | ]{gitexinfo} 52 | " 53 | 54 | # Hoover up the metadata 55 | git --no-pager log -1 --date=short --decorate=short --pretty=format:"$FMT" HEAD 56 | -------------------------------------------------------------------------------- /support/latex/sbabook/lstsmalltalk.sty: -------------------------------------------------------------------------------- 1 | \ProvidesFile{lstsmalltalk.sty} 2 | [2009/07/03 0.2 listings Smalltalk definitions file] 3 | % 4 | \RequirePackage{listings}% 5 | \RequirePackage{ifthen} 6 | % \RequirePackage{graphicx}% 7 | % \RequirePackage{stmaryrd}% 8 | % 9 | \newboolean{quickdefs}\setboolean{quickdefs}{true} 10 | \DeclareOption{nodefs}{\setboolean{quickdefs}{false}} 11 | \ProcessOptions\relax 12 | 13 | \ifthenelse{\boolean{quickdefs}} 14 | {\lstset{ 15 | basicstyle=\ttfamily, 16 | stringstyle=\itshape, 17 | escapeinside={_}{_}, 18 | columns=fullflexible, 19 | % frame=tb, 20 | floatplacement=htb}} 21 | {} 22 | 23 | \lstnewenvironment{smalltalk}[1][] 24 | {\lstset{language=Smalltalk,#1}} 25 | {} 26 | \newcommand{\st}[1]{{\lstset{language=Smalltalk}\lstinline{#1}}} 27 | 28 | 29 | \lstdefinelanguage{Smalltalk}{ 30 | morekeywords={self,super,true,false,nil,thisContext}, 31 | morestring=[d]', 32 | morecomment=[s]{"}{"}, 33 | alsoletter={\#:}, 34 | upquote=true, 35 | showstringspaces=false, 36 | literate= 37 | % {.}{{\bfseries .}}1 38 | % {;}{{\bfseries ;}}1 39 | % {[}{{\bfseries [}}1 40 | % {]}{{\bfseries ]}}1 41 | % {:}{{\bfseries :}}1 42 | % % {|}{{\ttfamily\textbar{}}}1 43 | % {\#}{{\ttfamily \#}}1 44 | % {\$}{{\ttfamily \$}}1 45 | % {:=}{{$\mathrel{\mathop:}=$\ }}2%$\shortleftarrow$\ }}2 46 | % {^}{{\raisebox{0.5ex}{$\wedge$}}}1%\raisebox{1.5ex}{\scalebox{1}[-1]{$\lightning$}}\,}}2%\textuparrow\ }}2 47 | {>>}{{\,>>\ }}3, 48 | tabsize=4 49 | }[keywords,comments,strings]% 50 | \endinput 51 | %%% 52 | %%% And now for something completely different... Some stupid example, 53 | %%% to put in a file to test this language definition... 54 | %%% 55 | % \lstset{ 56 | % inputencoding=utf8, 57 | % columns=fullflexible, 58 | % basicstyle=\Large 59 | % } 60 | % 61 | % \begin{lstlisting}[language=Smalltalk] 62 | % SomeClass >> testNumberOfRelationships 63 | % "this is a test" 64 | % | bazEntity | 65 | % self assert: fooEntity numberOfOutgoingRelationships = 1. 66 | % bazEntity := MyEntity named: #baz. 67 | % MyRelationship from: fooEntity to: bazEntity. 68 | % self assert: fooEntity numberOfOutgoingRelationships = 2. 69 | % string := 'Hello, world!' 70 | % aCollection do: [ each | 71 | % | local | 72 | % each someMessage ]. 73 | % ^ string 74 | % \end{lstlisting} 75 | %%%%%%%% 76 | % Local Variables: 77 | % coding: utf-8 78 | % End: 79 | -------------------------------------------------------------------------------- /support/latex/sbabook/pharo-titlepage.sty: -------------------------------------------------------------------------------- 1 | \ProvidesFile{pharo-titlepage.sty} 2 | [2017/05/10 0.1 title page design for SBA booklets] 3 | 4 | \DeclareOption{maketitle}{% 5 | \renewcommand{\maketitle}{\pharotitle}} 6 | \ProcessOptions 7 | 8 | \RequirePackage{xcolor} 9 | \RequirePackage{tikz} 10 | \usetikzlibrary{calc} 11 | \usetikzlibrary{svg.path} 12 | 13 | % fixup TikZ page coordinates for memoir stock & trimming 14 | % https://tex.stackexchange.com/questions/233455/using-tikz-current-page-node-in-memoir-class 15 | \newcommand\setpagenode{% 16 | \expandafter\def\csname pgf@sh@ns@current page\endcsname{rectangle}% 17 | \strictpagecheck% 18 | \checkoddpage% 19 | \ifoddpage% 20 | \expandafter\def\csname pgf@sh@np@current page\endcsname{% 21 | \def\southwest{\pgfpoint{\stockwidth-\paperwidth-\trimedge}% 22 | {\stockheight-\trimtop-\paperheight}}% 23 | \def\northeast{\pgfpoint{\stockwidth-\trimedge}{\stockheight-\trimtop}}% 24 | }% 25 | \else 26 | \expandafter\def\csname pgf@sh@np@current page\endcsname{% 27 | \def\southwest{\pgfpoint{\trimedge}{\stockheight-\trimtop-\paperheight}}% 28 | \def\northeast{\pgfpoint{\trimedge+\paperwidth}{\stockheight-\trimtop}}% 29 | }% 30 | \fi 31 | \expandafter\def\csname pgf@sh@nt@current page\endcsname{{1}{0}{0}{1}{0pt}{0pt}}% 32 | \expandafter\def\csname pgf@sh@pi@current page\endcsname{pgfpageorigin}} 33 | \pgfkeys{/tikz/overlay/.add code={}{\setpagenode}} 34 | 35 | \definecolor{PharoBlue}{HTML}{2B98D8} 36 | \definecolor{PharoDarkBlue}{HTML}{164C6C} 37 | \definecolor{PharoRed}{HTML}{A10B0B} 38 | 39 | \definecolor{BeaconOrange}{HTML}{F7931E} 40 | \definecolor{BeaconRed}{HTML}{ED1C24} 41 | 42 | \definecolor{LightShade}{HTML}{EEEEEE} 43 | 44 | \pgfdeclarelayer{background} 45 | \pgfsetlayers{background,main} 46 | 47 | \newcommand\pharotitle{ 48 | \thispagestyle{empty} 49 | 50 | \begin{tikzpicture}[remember picture,overlay,line width=0mm] 51 | \coordinate (left) at (current page.west); 52 | \coordinate (right) at (current page.east); 53 | \coordinate (top) at (current page.north); 54 | \coordinate (center) at (current page.center); 55 | \coordinate (bottom) at (current page.south); 56 | 57 | \coordinate (stocktopleft) at ([left=\trimedge,above=\trimtop]current page.north west); 58 | \coordinate (stockbottomright) at ([right=\stockwidth,below=\stockheight]stocktopleft); 59 | 60 | \coordinate (horizon) at ($ (top)!.618!(center) $); 61 | \coordinate (depths) at ($ (center)!.618!(bottom) $); 62 | 63 | \newcommand\beaconscaling{(.191\paperheight/120pt)} % golden ratio factor & approx. height of beacon tower 64 | \coordinate (beacon) at ($ (horizon -| left) $); 65 | 66 | \pgfdeclareverticalshading{column}{100bp}{ 67 | color(0)=(PharoBlue); 68 | color(40)=(PharoBlue); 69 | color(75)=(PharoRed); 70 | color(100)=(PharoRed)} 71 | 72 | \node[anchor=north east] at ($ (horizon -| right) + (-.1\pagewidth,-2cm) $) { 73 | \begin{varwidth}{.8\pagewidth} 74 | \flushright \fontsize{50pt}{60pt}\sffamily\bfseries\color{white} 75 | \@title 76 | \end{varwidth} 77 | }; 78 | 79 | \node[anchor=south east] at ($ (depths -| right) + (-.1\pagewidth,1cm) $) { 80 | \begin{varwidth}{.8\pagewidth} 81 | \flushright \HUGE\sffamily\color{white} 82 | \@author 83 | \end{varwidth} 84 | }; 85 | 86 | \node[anchor=north east] at ($ (depths -| right) + (-.1\pagewidth,-.5cm) $) { 87 | \begin{varwidth}{.8\pagewidth} 88 | \flushright \huge\sffamily\color{PharoDarkBlue!50!PharoBlue!50!LightShade} 89 | \ifx\@empty\@series\else\@series\titlebreak\fi 90 | \@date 91 | \end{varwidth} 92 | }; 93 | 94 | \begin{pgfonlayer}{background} 95 | \fill[LightShade] (stocktopleft) rectangle (horizon -| stockbottomright); 96 | \fill[PharoBlue] (horizon -| stocktopleft) rectangle (depths -| stockbottomright); 97 | \fill[PharoDarkBlue] (depths -| stocktopleft) rectangle (stockbottomright); 98 | 99 | \begin{scope}[ 100 | transform canvas={shift=(beacon)}, 101 | scale=\beaconscaling] 102 | 103 | \pharobeacon@tikz 104 | 105 | \end{scope} 106 | \end{pgfonlayer} 107 | \end{tikzpicture} 108 | \newpage 109 | } 110 | 111 | \newcommand\pharobeacon@tikz{ 112 | % beacon fire 113 | \shade[bottom color=BeaconRed, top color=BeaconOrange] svg { 114 | m 68.58,118.36 0,-14.22 22.72,0 0,15.14 -11.16,2.74 -11.56,-3.66 115 | z 116 | }; 117 | 118 | % cap 119 | \fill[PharoDarkBlue] svg[yscale=-1] { 120 | m 0,-138 121 | m 67.39,22.47 122 | c 0.23,-0.63 1.25,-1.52 2.83,-2.36 2.32,-1.24 5.84,-2.38 9.79,-2.43 6.63,-0.1 12.1,2.87 12.7,4.41 123 | l 0.06,0 0,-0.01 124 | c -0.06,-3.58 -5.2,-10.05 -11.7,-10.26 125 | l -3.15,0.11 126 | c -6.05,0.62 -10.64,7.12 -10.59,10.53 127 | l 0,0.01 0.06,0 128 | z 129 | }; 130 | 131 | % column 132 | \shade[shading=column] svg[yscale=-1] { 133 | % starting from top… 134 | m 75.55,-107.81 135 | c -6.21,0.44 -11.87,2.99 -11.87,2.99 136 | l 0,0 0,5.38 137 | c 0,0 -0.03,1.36 2.63,2.25 138 | l 0,0 0.13,5.46 139 | c -7.22,0.95 -12.04,2.56 -12.01,4.31 l 0,0 140 | c 0,0.44 2.25,3.62 2.25,3.62 l 0,0 141 | c 0,0 0.78,0.96 1.72,1.1 l 0,0 142 | c 0.94,0.14 2.58,0.95 3.64,1.82 l 0,0 143 | c 1.07,0.87 1.95,2.52 1.97,3.69 l 0,0 144 | c 0.02,1.16 1.2,2.1 2.62,2.07 l 0,0 3.39,-0.05 145 | c -4.06,2.31 -5.35,4.76 -6.55,6.46 l 0,0 146 | c -1.24,1.74 -2.28,16.8 -2.28,16.8 l 0,0 147 | c 0,0 0.57,-1.52 2.88,-5.11 l 0,0 148 | c 2.31,-3.58 11.46,-8.51 18.35,-12.25 l 0,0 149 | c 5.78,-3.14 11.02,-6.26 11.02,-6.26 l 0,0 150 | c 1.34,-0.78 2.55,-1.43 2.55,-2.58 l 0,0 151 | c 0,-1.4 0.59,-3.08 1.35,-3.73 l 0,0 152 | c 0.76,-0.67 2.15,-1.33 3.09,-1.5 l 0,0 153 | c 0.93,-0.16 1.68,-1.15 1.68,-1.15 l 0,0 154 | c 0,0 2.14,-3.25 2.13,-3.69 l 0,0 155 | c -0.02,-1.67 -4.44,-3.07 -11.12,-3.83 l 0,0 -0.13,-5.41 156 | c 1.94,-0.59 3.09,-1.28 3.07,-2.02 l 0,0 0,-5.38 157 | c 0,0 -5.07,-2.81 -11.83,-3.11 l 0,0 158 | c -2.42,0 -6.33,0 -8.67,0.12 159 | % …then the middle stripe 160 | m 6.9,52.91 161 | c -15.04,7.24 -22.43,10.89 -23.5,18.67 l 0,0 162 | c -1.07,7.78 -2.22,15.42 -2.22,15.42 l 0,0 163 | c 0.93,-5.6 11.84,-12.19 22.76,-17.5 l 0,0 164 | c 10.92,-5.3 18.74,-8.75 18.23,-14.51 l 0,0 165 | c -0.45,-5.14 -1.54,-12.22 -1.77,-13.67 l 0,0 166 | c 0.08,1.08 -0.57,5.38 -13.49,11.6 167 | % …finally the bottom stripe 168 | m -2.19,34.15 169 | c -20.34,9.48 -25.38,12.09 -25.97,17.91 l 0,0 170 | c -0.51,5.01 -1.68,15.57 -2,18.42 l 0,0 171 | c 0.39,-1.55 2.49,-5.54 13.28,-11.4 l 0,0 172 | c 14.1,-7.67 36.69,-14.04 36.14,-22.06 l 0,0 173 | c -0.54,-8.02 -2.06,-18.59 -2.06,-18.59 l 0,0 174 | c 0,0 0.94,6.24 -19.4,15.73 175 | }; 176 | 177 | % flare 178 | \fill[white, opacity=.7] svg[yscale=-1] { 179 | m 138.94,-165.83 180 | c -78.62,68.64 -72.74,53.81 -18,45.42 181 | -54.74,8.39 -63.63,-4.87 27.19,40.57 182 | -90.82,-45.44 -74.9,-44.42 -48.75,-3.09 183 | -26.15,-41.33 -16.29,-53.88 -30.19,38.41 184 | 13.9,-92.29 17.86,-76.83 -12.12,-47.32 185 | 29.99,-29.51 44.96,-24.01 -45.85,-16.84 186 | 90.82,-7.17 77.34,1.37 41.26,-26.16 187 | 36.08,27.52 35.48,43.47 1.84,-48.82 188 | 33.63,92.3 21.35,82.11 37.62,31.17 189 | -16.27,50.94 -31.63,55.3 47,-13.34 190 | }; 191 | } -------------------------------------------------------------------------------- /support/latex/sbabook/sba-logo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SquareBracketAssociates/ExploringVMs/209a1bab257468e37fbbfea3cb2b651722339392/support/latex/sbabook/sba-logo.pdf -------------------------------------------------------------------------------- /support/latex/sbabook/sbabook.cls: -------------------------------------------------------------------------------- 1 | \NeedsTeXFormat{LaTeX2e} 2 | \ProvidesClass{sbabook}[2013/03/08] 3 | 4 | % \ExecuteOptions{a4paper,11pt,twoside} 5 | \ProcessOptions* 6 | \LoadClassWithOptions{memoir} 7 | 8 | \RequirePackage{graphicx} 9 | \RequirePackage{xcolor} 10 | \renewcommand{\trimmarkscolor}{\color{cyan}} 11 | 12 | %%% 13 | %%% Page layout 14 | %%% 15 | \newcommand{\stockustrade}{\setstocksize{9in}{6in}}% Lulu final book proportions 16 | \newcommand{\stockaivus}{\setstocksize{11in}{210mm}}% intersection of A4 and US Letter 17 | \newcommand{\setbleed}[1]{% 18 | \settrimmedsize{\stockheight}{\stockwidth}{*}% 19 | \settrims{#1}{#1}% 20 | \advance\stockheight 2\trimtop 21 | \advance\stockwidth 2\trimedge} 22 | \newcommand{\paperbackpage}{ 23 | \stockustrade 24 | \setbleed{.125in} 25 | % \setbinding{5mm} 26 | \setlrmarginsandblock{.85in}{.65in}{*} 27 | \setulmarginsandblock{.75in}{.75in}{*}} 28 | \newcommand{\spiralboundpage}{ 29 | \stockaivus 30 | \setbleed{0pt}% trims not required (unless we deliver this via Lulu as well?) 31 | \setlrmarginsandblock{1.25in}{1.25in}{*} 32 | \setulmarginsandblock{.75in}{1in}{*}} 33 | \newcommand{\pagelayout}[1]{ 34 | \providecommand{\setuppage}{#1}% set default page layout 35 | \setuppage\checkandfixthelayout 36 | \typeoutlayout} 37 | 38 | \settypeoutlayoutunit{mm} 39 | 40 | \raggedbottom 41 | 42 | %%% 43 | %%% Fonts & paragraph typography 44 | %%% 45 | \RequirePackage{fontspec} 46 | 47 | \setmainfont[ 48 | Ligatures=TeX, % supposed to replace Mapping=tex-text 49 | UprightFont = {Gentium Book Basic}, 50 | ItalicFont = {Gentium Book Basic Italic} 51 | ]{Gentium Basic} 52 | \setsansfont[ 53 | Scale=MatchLowercase, 54 | BoldFont = {* Bold}, 55 | Ligatures=TeX, 56 | Numbers=OldStyle 57 | ]{Open Sans} 58 | \setmonofont[ 59 | Scale=MatchLowercase 60 | ]{Fira Mono}%{Hack} 61 | \let\codefamily\ttfamily 62 | \newcommand\textcode[1]{\texttt{#1}} 63 | 64 | \noindentafterchapter 65 | \setlength{\parindent}{1.5em} 66 | \nonzeroparskip 67 | 68 | \firmlists 69 | \renewcommand*{\descriptionlabel}[1]{% 70 | \hspace\labelsep 71 | \normalfont\sffamily #1} 72 | 73 | \RequirePackage{ragged2e} 74 | \RaggedRight 75 | \RequirePackage{varwidth} 76 | \newenvironment{balanced}[1]{% 77 | \CenteringLeftskip 0pt plus 6em% 78 | \CenteringRightskip 0pt plus 6em% 79 | \RaggedLeftLeftskip 0pt plus 12em% 80 | \RaggedRightRightskip 0pt plus 12em% 81 | \begin{varwidth}{#1}% 82 | }{\end{varwidth}} 83 | 84 | %% margin content 85 | \sideparmargin{outer} 86 | \renewcommand\sideparfont{\footnotesize\sffamily} 87 | \renewcommand\sideparform{\ifmemtortm\RaggedRight\else\RaggedLeft\fi} 88 | % \setmpjustification{\RaggedLeft}{\RaggedRight} % this is for margin floats 89 | 90 | % footnotes at bottom of page instead of below text (which is ragged bottom) 91 | % also moves footnotes below bottom-of-page floats 92 | \RequirePackage[bottom]{footmisc} 93 | 94 | 95 | %%% 96 | %%% Title page 97 | %%% 98 | 99 | % similar to \title, \author, \date from latex.ltx 100 | \def\series#1{\gdef\@series{#1}} 101 | \let\@series\@empty 102 | 103 | \setlength\droptitle{5cm} 104 | \pretitle{\begin{flushright}\HUGE\sffamily} 105 | \posttitle{\par\end{flushright}\vskip 1cm} 106 | \preauthor{\begin{flushright} 107 | \large\sffamily 108 | \begin{tabular}[t]{r@{}}} 109 | \postauthor{\end{tabular}\par\end{flushright}} 110 | \predate{\begin{flushright}\large\sffamily} 111 | \postdate{\par\end{flushright}} 112 | 113 | % place authors on separate lines 114 | % memoir provides \andnext, and normally \\ is used to add data under the 115 | % author's name, like affiliation, email… 116 | \renewcommand\and{\\} 117 | 118 | % line break in title, hopefully without polluting PDF metadata etc 119 | \newcommand\titlebreak[2][]{\texorpdfstring{#1\protect\\}{#2}} 120 | 121 | %%% 122 | %%% Sectioning 123 | %%% 124 | 125 | %% chapter heading 126 | \newlength{\chapnumheight}\setlength{\chapnumheight}{18mm} 127 | \makechapterstyle{sba}{% 128 | \renewcommand{\chapnamefont}{% 129 | \LARGE\sffamily\bfseries 130 | \addfontfeature{LetterSpace=20}% 131 | \flushright\MakeUppercase} 132 | \renewcommand{\chapnumfont}{% 133 | \HUGE\sffamily\bfseries 134 | \addfontfeature{Numbers={Proportional,Lining}}} 135 | \renewcommand{\chaptitlefont}{\HUGE\sffamily\mdseries\flushright} 136 | \renewcommand*{\chapterheadstart}{} 137 | \renewcommand*{\chapternamenum}{} 138 | \renewcommand*{\afterchapternum}{\par\nobreak\vskip 25pt} 139 | \renewcommand*{\printchapternum}{% 140 | \resizebox{!}{\chapnumheight}{\chapnumfont \,\thechapter}% 141 | \rlap{% 142 | \kern .3\chapnumheight 143 | \rule{\foremargin}{\chapnumheight}}} 144 | \setlength{\afterchapskip}{8\baselineskip} 145 | %% chapter precis 146 | \renewcommand\precisfont{\normalfont\sffamily\RaggedLeft\small} 147 | \newlength{\postchapterprecisskip} 148 | \setlength{\prechapterprecisshift}{-4\baselineskip} 149 | \setlength{\postchapterprecisskip}{\baselineskip} 150 | \renewcommand\prechapterprecis{% 151 | \precisfont 152 | \vspace*{-\postchapterprecisskip}% 153 | \vspace*{-4\baselineskip}} 154 | \renewcommand\postchapterprecis{\vspace*{\postchapterprecisskip}} 155 | %%% fix indentation of 1st paragraph after \chapterprecis 156 | %% cf https://groups.google.com/forum/#!msg/comp.text.tex/yj4ZoVlbSKE/5hJXO-2jG5EJ 157 | % \addtoiargdef\chapterprecis{}{% 158 | % \par\@afterheading\m@mindentafterchapter} 159 | } 160 | 161 | % \renewcommand\chapterprecishere[1]{% 162 | % \prevgraf0 163 | % \prechapterprecis #1\postchapterprecis 164 | % {\count0 \numexpr3-\prevgraf\relax 165 | % \precisfont% just needed in case this did a size change so get right baseline 166 | % \ifnum\count0 >0 \vspace{\count0 \baselineskip}\fi}} 167 | \renewcommand\chapterprecishere[1]{% 168 | {\prechapterprecis 169 | \begin{minipage}[t]{\linewidth}% 170 | \flushright 171 | \begin{balanced}{\linewidth}% 172 | \prevgraf0 173 | \strut#1\strut\par 174 | \xdef\precistmp{\noexpand\precisskip{\the\prevgraf}{\the\baselineskip}}% 175 | \end{balanced}\par% 176 | \end{minipage}% 177 | \precistmp 178 | \postchapterprecis 179 | }% 180 | \par 181 | \@afterheading 182 | } 183 | \def\precisskip#1#2{{% 184 | \count0 \numexpr4-#1\relax 185 | \dimen0=#2 % 186 | \ifnum\count0 >0 \vspace*{\count0 \dimen0}\fi}} 187 | 188 | 189 | \makeheadstyles{sba}{% 190 | \renewcommand*{\booknamefont} {\normalfont\huge\sffamily} 191 | \renewcommand*{\booknumfont} {\normalfont\huge\sffamily} 192 | \renewcommand*{\booktitlefont}{\normalfont\Huge\sffamily} 193 | \renewcommand*{\partnamefont} {\normalfont\huge\sffamily} 194 | \renewcommand*{\partnumfont} {\normalfont\huge\sffamily} 195 | \renewcommand*{\parttitlefont}{\normalfont\Huge\sffamily} 196 | \chapterstyle{sba} 197 | \setsecheadstyle {\LARGE\sffamily\bfseries} 198 | \setsubsecheadstyle {\Large\sffamily\bfseries} 199 | \setsubsubsecheadstyle{\Large\sffamily} 200 | \setparaheadstyle {\sffamily\bfseries} 201 | \setsubparaheadstyle {\sffamily} 202 | \setsecnumformat{% 203 | \llap{\mdseries 204 | \csname the##1\endcsname 205 | \quad}} 206 | } 207 | 208 | \headstyles{sba} 209 | \setsecnumdepth{section} 210 | \settocdepth{section} 211 | 212 | 213 | %%% 214 | %%% Page styles & folios 215 | %%% 216 | \def\headfootfont{\small\sffamily} 217 | %% main page style variant 218 | \makepagestyle{sba-headings} 219 | \makeevenhead{sba-headings}{}{}{\ifonlyfloats{}{\headfootfont\leftmark}} 220 | \makeoddhead {sba-headings}{\ifonlyfloats{}{\headfootfont\rightmark}}{}{} 221 | \makeevenfoot{sba-headings}{\headfootfont\bfseries\thepage}{}{} 222 | \makeoddfoot {sba-headings}{}{}{\headfootfont\bfseries\thepage} 223 | \makepsmarks{sba-headings}{\nouppercaseheads 224 | \createmark{chapter}{left}{nonumber}{}{} 225 | \createmark{section}{right}{shownumber}{}{\quad}} 226 | %% page style variant without headings 227 | \makepagestyle{sba-plain} 228 | \makeevenfoot{sba-plain}{\headfootfont\bfseries\thepage}{}{} 229 | \makeoddfoot {sba-plain}{}{}{\headfootfont\bfseries\thepage} 230 | %% no folio on float-only pages 231 | \mergepagefloatstyle{sba}{sba-headings}{empty} 232 | 233 | \aliaspagestyle{plain}{sba} 234 | \aliaspagestyle{book}{empty} 235 | \aliaspagestyle{part}{empty} 236 | \aliaspagestyle{chapter}{sba-plain} 237 | 238 | %%% 239 | %%% Floats 240 | %%% 241 | \captionnamefont{\sffamily\bfseries} 242 | \captiontitlefont{\sffamily} 243 | \renewcommand\sidecapfloatwidth{.5\linewidth}% ahould adjust \sidecapwidth accordingly 244 | \captionstyle[\RaggedRight]{\RaggedRight} 245 | \captiondelim{\quad} 246 | 247 | \setfloatadjustment{figure}{\small\sffamily\centering} 248 | \setfloatadjustment{table} {\small\sffamily\centering} 249 | 250 | %%% 251 | %%% Graphics 252 | %%% 253 | \RequirePackage{tikz} 254 | \usetikzlibrary{calc} 255 | \usetikzlibrary{decorations.pathmorphing} 256 | \definecolor{shadecolor}{gray}{0.9} % FIXME really needed? 257 | 258 | % dash pattern for margin brackets that cross pages 259 | % last dash is supposed to be infinite but in practice the page height is enough 260 | \tikzstyle{dashfade}=[ 261 | dash pattern = on 0.5pt off 1pt on 1pt off 1pt on 2pt off 1pt on \paperheight] 262 | 263 | \RequirePackage[listings,breakable,skins]{tcolorbox} 264 | 265 | %%% 266 | %%% Source code 267 | %%% 268 | \RequirePackage{listings} 269 | 270 | % \renewcommand{\lstlistlistingname}{Code examples} 271 | \lstdefinestyle{sbabook}{ 272 | inputencoding=utf8, 273 | aboveskip=0pt, belowskip=0pt, 274 | columns=fullflexible, 275 | keepspaces, 276 | breaklines, 277 | breakatwhitespace, 278 | showstringspaces=false, 279 | mathescape=false, 280 | tabsize=2, 281 | keywordstyle={}, 282 | stringstyle={}, 283 | commentstyle={}, 284 | } 285 | \lstset{style = sbabook} 286 | 287 | 288 | \lstdefinelanguage{plain}{}% verbatim, plain text 289 | 290 | % inline code 291 | \let\code\lstinline 292 | 293 | \tcbset{ 294 | sba/.style = { 295 | empty, size = minimal, 296 | blend before title code = {\begingroup\@contnfont ##1\@contdelim\endgroup}, 297 | floatplacement = tb, 298 | fonttitle=\@conttfont, 299 | coltitle = black, 300 | listing only, 301 | listing options = { 302 | style = sbabook, 303 | basicstyle = \small\codefamily, 304 | language = {#1} 305 | }, 306 | breakable, 307 | frame code = {\draw 308 | ([xshift=-2pt]interior.south west) 309 | --([xshift=-4pt]interior.south west) 310 | --([xshift=-4pt]interior.north west) 311 | --([xshift=-2pt]interior.north west); 312 | }, 313 | skin first is subskin of = {emptyfirst}{% 314 | frame code = { 315 | \draw[dashfade] ([xshift=-4pt]interior.south west) |- ([xshift=-2pt]interior.north west); 316 | }}, 317 | skin middle is subskin of = {emptymiddle}{% 318 | frame code = { 319 | \draw[dashfade] ([xshift=-4pt]interior.south west) 320 | --($([xshift=-4pt]interior.south west)!.5!([xshift=-4pt]interior.north west)$); 321 | \draw[dashfade] ([xshift=-4pt]frame.north west) 322 | --($([xshift=-4pt]interior.south west)!.5!([xshift=-4pt]interior.north west)$); 323 | }}, 324 | skin last is subskin of = {emptylast}{% 325 | frame code = { 326 | \draw[dashfade] ([xshift=-4pt]interior.north west) |- ([xshift=-2pt]interior.south west); 327 | }} 328 | } 329 | } 330 | 331 | % Block-level listings, breakable across multiple pages, with a bracket in the 332 | % left margin 333 | \newtcblisting{displaycode}[2][]{sba={#2}, #1} 334 | 335 | \newtcblisting[ 336 | % nearly identical to what "blend into=figures" would do, except for /tcb/code 337 | use counter* = figure, 338 | list inside = lof, 339 | list type = listing, 340 | /tcb/code = {\appto\tcb@new@colopt{,before title={\tcb@blend@beforetitle{\lstlistingname~\thefigure}}}} 341 | % crefname={listing}{listings}, 342 | % Crefname={Listing}{Listings} 343 | ]{listing}[3][]{ 344 | sba={#2}, 345 | title={#3}, 346 | bottomtitle = 1ex, 347 | list entry = {\protect\numberline{\thefigure}{\ignorespaces #3}}, 348 | #1 349 | } 350 | 351 | %%% 352 | %%% Table of contents appearance 353 | %%% 354 | \cftpagenumbersoff{part} 355 | \setlength{\cftbeforepartskip}{2em plus 1.5em minus .75em} 356 | 357 | \addtodef\tableofcontents{\clearforchapter}{} 358 | \renewcommand\cftpartfont{\sffamily\large\bfseries} 359 | \let\cftpartpagefont\cftpartfont% unused, but for coherence 360 | \renewcommand\cftpartleader{} 361 | \renewcommand\cftpartafterpnum{\cftparfillskip} 362 | \setlength{\cftbeforechapterskip}{1em plus .5em minus .2em} 363 | \renewcommand{\cftchapterbreak}{\pagebreak[2]} 364 | 365 | \renewcommand\cftchapterfont{\sffamily\bfseries} 366 | \let\cftchapterpagefont\cftchapterfont 367 | \renewcommand\precistocfont{\normalfont\sffamily\itshape\small} 368 | \renewcommand\precistocformat{% discourage hyphenation 369 | \hyphenpenalty=5000 370 | \tolerance=1000 371 | \noindent\narrowragged} 372 | 373 | % TODO balance precis in TOC 374 | \renewcommand\cftsectionfont{\sffamily} 375 | \let\cftsectionpagefont\cftsectionfont 376 | \renewcommand\cftsubsectionfont{\sffamily\itshape} 377 | \let\cftsubsectionpagefont\cftsectionfont 378 | \cftsetindents{part}{0pt}{0em} 379 | \renewcommand{\cftpartpresnum}{\hspace{-4em}\hfill} 380 | \renewcommand{\cftpartaftersnum}{\quad} 381 | \cftsetindents{chapter}{0pt}{0em} 382 | \renewcommand{\cftchapterpresnum}{\hspace{-4em}\hfill} 383 | \renewcommand{\cftchapteraftersnum}{\quad} 384 | \cftsetindents{section}{0pt}{0em} 385 | \renewcommand{\cftsectionpresnum}{\hspace{-4em}\hfill} 386 | \renewcommand{\cftsectionaftersnum}{\quad} 387 | \cftsetindents{subsection}{0pt}{3em} 388 | \setrmarg{3.55em plus 1fil}% help avoid hyphenation 389 | 390 | %% Combine figures, tables, listings into a single list. We redirect everything 391 | %% to the list of figures 392 | \renewcommand\listfigurename{Illustrations} 393 | \renewcommand\ext@table{lof} 394 | 395 | %% figures & tables, like sections 396 | \cftsetindents{figure}{0pt}{0em} 397 | \let\cftfigurefont\cftsectionfont 398 | \let\cftfigurepagefont\cftfigurefont 399 | \renewcommand\cftfigurepresnum{\hspace{-4em}\hfill} 400 | \renewcommand\cftfigureaftersnum{\quad} 401 | 402 | \let\c@table\c@figure 403 | \let\l@table\l@figure 404 | 405 | % redefining the counter it taken care of by \newtcblisting 406 | % \let\c@listing\c@figure 407 | \let\l@listing\l@figure 408 | 409 | %% counter appearance is reset at front/main/back matter 410 | \renewcommand\@memmain@floats{% 411 | \counterwithin{figure}{chapter} 412 | \renewcommand\thefigure{\thechapter-\arabic{figure}} 413 | \let\thetable\thefigure} 414 | 415 | %% verbatim setup 416 | \bvtopandtail % \bvsides 417 | \setlength{\bvboxsep}{.25em} 418 | \tabson[4] 419 | \setverbatimfont{\normalfont\codefamily\small} 420 | 421 | \DeclareRobustCommand{\LaTeX}{% 422 | {% copied from Grzegorz Murzynowski's article in TUGboat 29(1) 423 | L% 424 | \setbox\z@\hbox{\check@mathfonts 425 | \fontsize\sf@size\z@ 426 | \math@fontsfalse\selectfont 427 | A}% 428 | \kern-.57\wd\z@ 429 | \sbox\tw@ T% 430 | \vbox to\ht\tw@{\copy\z@ \vss}% 431 | \kern-.2\wd\z@}% 432 | {% 433 | \ifdim\fontdimen1\font=\z@ 434 | \else 435 | \count\z@=\fontdimen5\font 436 | \multiply\count\z@ by 64\relax 437 | \divide\count\z@ by\p@ 438 | \count\tw@=\fontdimen1\font 439 | \multiply\count\tw@ by\count\z@ 440 | \divide\count\tw@ by 64\relax 441 | \divide\count\tw@ by\tw@ 442 | \kern-\the\count\tw@ sp\relax 443 | \fi}% 444 | \TeX} 445 | 446 | %%% 447 | %%% Language, localizations, hyphenation 448 | %%% 449 | \RequirePackage{polyglossia} 450 | 451 | -------------------------------------------------------------------------------- /support/latex/sbabook/sbabook.spiral.tex: -------------------------------------------------------------------------------- 1 | \providecommand{\setuppage}{\spiralboundpage}\input{sbabook} 2 | -------------------------------------------------------------------------------- /support/latex/sbabook/sbabook.tex: -------------------------------------------------------------------------------- 1 | \documentclass[english,twoside,openany,showtrims]{sbabook} 2 | 3 | \pagelayout{\paperbackpage} 4 | 5 | \usepackage[useregional]{datetime2} 6 | 7 | % extract info from git commit 8 | % requires gitinfo2 2.0.7, and below fix needed until 2.0.8 released 9 | \makeatletter 10 | \let\THEDAY\@dtm@currentday 11 | \let\THEMONTH\@dtm@currentmonth 12 | \let\THEYEAR\@dtm@currentyear 13 | \makeatother 14 | \usepackage[local,dirty=*]{gitinfo2} 15 | \usepackage{xstring}% \IfEq and \StrCut 16 | % a couple extensions... 17 | \makeatletter 18 | \newcommand\gitCommitInfo{% 19 | \IfEq{\gitRel}{} 20 | {commit \texttt{\gitAbbrevHash\gitDirty}} 21 | {\IfEq{\gitRoff}{0} 22 | {release \gitRel} 23 | {modified since release \gitRel{} --- commit \texttt{\gitAbbrevHash\gitDirty}}}} 24 | \newcommand\gitdate{\DTMusedate{gitdate}} 25 | \makeatother 26 | 27 | % \setotherlanguage{latin} 28 | % \usepackage{lipsum} 29 | 30 | \usepackage{multirow} 31 | \usepackage{graphicx} 32 | 33 | \usepackage{lstsmalltalk} 34 | 35 | \usepackage{url} % define and apply style to URLs 36 | \def\url@sfstyle{\def\UrlFont{\sf}} 37 | \urlstyle{sf} 38 | \usepackage[unicode,breaklinks,hidelinks]{hyperref} % undecorated hyperlinks 39 | 40 | \title{the Square Bracket Associates\titlebreak{} 41 | \texorpdfstring{\protect\LaTeX}{LaTeX} book class} 42 | \author{Damien Pollet} 43 | \date{\gitdate\titlebreak[\smallskip]{ -- }\protect\gitCommitInfo} 44 | 45 | \hypersetup{pdfinfo = { 46 | Title = {\thetitle}, 47 | Author = {\theauthor}, 48 | Keywords = {LaTeX, document class, book, typography}}} 49 | 50 | \newcommand\hrefnote[3][]{% inline linked text, plus URL in footnote 51 | % \hrefnote[]{URL}{link text} 52 | \href{#2}{#3}\footnote{\url{#2} #1}} 53 | 54 | % a nice horizontal separator 55 | \newcommand{\sectionline}{% 56 | \begin{center}\nointerlineskip 57 | \rule{0.233\linewidth}{.7pt}% 58 | \end{center}} 59 | 60 | \begin{document} 61 | 62 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 63 | % Title page and colophon on verso 64 | \maketitle 65 | \pagestyle{titlingpage} 66 | \thispagestyle{titlingpage} % \pagestyle does not work on the first one… 67 | 68 | \cleartoverso 69 | {\small 70 | 71 | Copyright 2015 by Damien Pollet. 72 | 73 | The contents of this book are protected under the Creative Commons 74 | Attribution-ShareAlike 3.0 Unported license. 75 | 76 | You are \textbf{free}: 77 | \begin{itemize} 78 | \item to \textbf{Share}: to copy, distribute and transmit the work, 79 | \item to \textbf{Remix}: to adapt the work, 80 | \end{itemize} 81 | 82 | Under the following conditions: 83 | \begin{description} 84 | \item[Attribution.] You must attribute the work in the manner specified by the 85 | author or licensor (but not in any way that suggests that they endorse you 86 | or your use of the work). 87 | \item[Share Alike.] If you alter, transform, or build upon this work, you may 88 | distribute the resulting work only under the same, similar or a compatible 89 | license. 90 | \end{description} 91 | 92 | For any reuse or distribution, you must make clear to others the 93 | license terms of this work. The best way to do this is with a link to 94 | this web page: \\ 95 | \url{http://creativecommons.org/licenses/by-sa/3.0/} 96 | 97 | Any of the above conditions can be waived if you get permission from 98 | the copyright holder. Nothing in this license impairs or restricts the 99 | author's moral rights. 100 | 101 | \begin{center} 102 | \includegraphics[width=0.2\textwidth]{CreativeCommons-BY-SA.pdf} 103 | \end{center} 104 | 105 | Your fair dealing and other rights are in no way affected by the 106 | above. This is a human-readable summary of the Legal Code (the full 107 | license): \\ 108 | \url{http://creativecommons.org/licenses/by-sa/3.0/legalcode} 109 | 110 | \vfill 111 | 112 | \begin{tabular}{@{}c@{\quad}l} 113 | \multirow{2}{*}{\includegraphics[width=2em]{sba-logo.pdf}} 114 | & Developed for the books published by Square Bracket Associates. \\ 115 | & \url{http://squarebracketassociates.org} \\[\smallskipamount] 116 | \end{tabular} 117 | } 118 | 119 | 120 | \frontmatter 121 | \pagestyle{plain} 122 | 123 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 124 | \chapter*{About this document} 125 | 126 | This document is both the showcase and documentation of the SBAbook document 127 | class. 128 | You are of course encouraged to check its code, as a source of concrete examples. 129 | 130 | The primary goals of the SBAbook class are: 131 | \begin{itemize} 132 | \item to provide a nice design for the Square Bracket Associates books, 133 | \item to work as an export target for 134 | \hrefnote{https://github.com/pillar-markup}{Pillar}, the documentation markup 135 | used in the \hrefnote{http://pharo.org}{Pharo project}. 136 | \end{itemize} 137 | It is therefore meant more as a convenience class than a generic book class. 138 | In fact, SBAbook itself is pretty small; it relies heavily on the 139 | \hrefnote{https://www.ctan.org/pkg/memoir}{Memoir class} and on a selection of 140 | additional packages, which it parameterizes to implement a specific design, from 141 | page layout and typography to semantic markup. 142 | 143 | The result is a class that should work well for technical books and should still 144 | be pretty flexible, but which also has a few requirements and makes technical 145 | choices on its own. 146 | This document will thus only describe the specifics of SBAbook and its requirements. 147 | 148 | 149 | \tableofcontents* 150 | 151 | \clearpage 152 | \listoffigures 153 | 154 | \mainmatter 155 | 156 | 157 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 158 | \chapter{Technical requirements} 159 | 160 | 161 | \section{Motivations} 162 | 163 | Reasons (fonts, packages) 164 | 165 | \begin{figure}[tb] 166 | \caption{A rather large representation of the icon for the Creative Commons 167 | license we at Square Bracket Associates use for our books.} 168 | \includegraphics{CreativeCommons-BY-SA} 169 | \label{fig:cc-by-sa-icon} 170 | \end{figure} 171 | 172 | 173 | \section{A pretty up-to-date TeXlive} 174 | 175 | how to update 176 | important packages 177 | 178 | 179 | \section{Building with Lua\LaTeX} 180 | 181 | how to run, latexmk 182 | 183 | 184 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 185 | \chapter{Page layout and design} 186 | 187 | 188 | \section{Font choices} 189 | 190 | In technical writing, and especially using \LaTeX{}, it's tempting to try to use 191 | fonts as a semantic markup of sorts; unfortunately, this only results in a 192 | jumble of too many fonts and uselessly noisy paragraphs. 193 | Granted, a technical book can never be as minimal as a novel typeset in a single 194 | size, single weight roman font, but some restraint should help maintain a clear 195 | visual hierarchy. 196 | We've thus tried to keep to a minimal set of fonts with clearly defined roles. 197 | Thankfully, there has been several impressive open-source fonts released in the 198 | last years, which made several combinations possible; in the end, we settled on 199 | three families in Table~\ref{tab:fontRoles}, which are all packaged in the 200 | \TeX{}live distribution. 201 | 202 | The workhorse font is \hrefnote[--- SIL Open Font 203 | License]{http://software.sil.org/gentium/}{Gentium}; it's compact, very legible, 204 | and not as cold as the fonts we usually see in \LaTeX{} documents. 205 | In titles, \hrefnote[--- Apache 206 | License]{https://www.google.com/fonts/specimen/Open+Sans}{Open Sans} gives a 207 | neutral but friendly impression; it is not overpowering and is very legible in 208 | small sizes, making it perfect for captions and page decorations. 209 | Finally, the font for source code excerpts and verbatim text is \hrefnote[--- 210 | SIL Open Font License]{https://mozilla.github.io/Fira/}{Fira Mono}. 211 | 212 | \begin{table} 213 | \caption{Fonts used in the document, and their roles} 214 | \begin{tabular}{ll} 215 | \toprule 216 | \textnormal{Gentium -- \textit{Italic}} & Primary, paragraph text \\ 217 | \textsf{Open Sans -- \textbf{Bold}} & Structural and secondary text: titles, captions \\ 218 | \texttt{Fira Mono} & Verbatim text and code \\ 219 | \bottomrule 220 | \end{tabular} 221 | \label{tab:fontRoles} 222 | \end{table} 223 | 224 | 225 | \section{Text layout} 226 | 227 | ragged right 228 | spaced paragraphs with no indent 229 | hanging section numbers 230 | 231 | 232 | \section{Custom semantic markup} 233 | 234 | chapterprecis 235 | constraints on content 236 | 237 | 238 | \section{Source code and listings} 239 | 240 | SBAbook provides custom high-level semantic markup for source code, which 241 | relies on the powerful \code{listings} and \code{tcolorbox} packages. 242 | 243 | 244 | \paragraph{Inline source code} 245 | For short mentions of source code in the middle of the text, use the 246 | \code§\code|...|§ macro. 247 | This macro is an alias to \code§\lstinline§, which works like verbatim: it uses 248 | an arbitrary delimiter. 249 | 250 | Using this macro with curly braces like \code§\code{this}§ is possible, but this 251 | is an experimental feature of \code{listings}, and it breaks in some cases; it's 252 | fine when used in paragraph text, but things get weird as soon as it's part of 253 | the argument of some other macro. 254 | Table~\ref{tab:codeDelims} lists a few characters in the ASCII range that are 255 | convenient as delimiters. 256 | 257 | \begin{table} 258 | \caption{Some convenient delimiters for inline code} 259 | \begin{tabular}{ll@{\qquad}ll} 260 | \toprule 261 | \code_\code|...|_ & pipe & \code¶\code§...§¶ & section sign \\ 262 | \code|\code_..._| & underscore & \code§\code¶...¶§ & pilcrow \\ 263 | \code¡\code!...!¡ & exclamation point & \code~\code$...$~ & dollar sign \\ 264 | \code!\code¡...¡! & inverse exclamation point & \code$\code~...~$ & tilde \\ 265 | \code¿\code?...?¿ & question mark & \code`\code^...^` & circumflex \\ 266 | \code?\code¿...¿? & inverse question mark & \code^\code`...`^ & backquote \\ 267 | \bottomrule 268 | \end{tabular} 269 | \label{tab:codeDelims} 270 | \end{table} 271 | 272 | 273 | \paragraph{Displayed source code} 274 | For multi-line excerpts of source code that should appear in the flow of the 275 | text, use the \code{displaycode} environment. 276 | You have to specify the language each excerpt of code is written in, as an 277 | argument; any language known to the \code{listings} package works. 278 | 279 | \begin{displaycode}{[Visual]Basic} 280 | 10 PRINT "Hello SBAbook!" 281 | 20 PRINT "This is a paragraph-level listing." 282 | 25 PRINT "UTF-8 in Basic: élèves français, Ελλάδα, Здравствуй, мир!" 283 | 30 GOTO 10 284 | \end{displaycode} 285 | 286 | 287 | \paragraph{Referenced listings} 288 | If you need a numbered source code listing that is referenced in the table of 289 | contents, use the \code{listing} environment, providing a descriptive caption as 290 | a second mandatory argument. 291 | To reference that listing from the text, the label must be provided as 292 | \code{label=something} in the optional argument, as in 293 | listing~\ref{lst:fooNewWith} below. 294 | Similarly, use the \code{list text} option from \code{tcolorbox} if the caption 295 | should be worded differently in the table of contents. 296 | 297 | \begin{listing}[label=lst:fooNewWith]{Smalltalk} 298 | {A factory method in class \code{Foo}} 299 | Foo class>>with: parameter 300 | ^ self new 301 | initializeWith: parameter 302 | \end{listing} 303 | 304 | 305 | \paragraph{Floating listings} 306 | To make a floating listing, simply add the \code{float} option in the 307 | environment's optional parameter. 308 | In case you really need to specify the placement, the usual specifiers can also 309 | be passed: \code{float=htbp}. 310 | 311 | 312 | \section{Packages and conventions} 313 | 314 | 315 | 316 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 317 | \clearpage 318 | % \textlatin{\lipsum[2-7]} 319 | 320 | \end{document} 321 | -------------------------------------------------------------------------------- /support/latex/spiral.preamble.tex: -------------------------------------------------------------------------------- 1 | \providecommand{\setuppage}{\spiralboundpage} 2 | \PassOptionsToPackage{maketitle}{root/support/latex/sbabook/pharo-titlepage} -------------------------------------------------------------------------------- /support/makefiles/epub.mk: -------------------------------------------------------------------------------- 1 | XHTMLTEMPLATE = ./support/templates/xhtml.mustache.template 2 | NAVMENUTEMPLATE = ./support/templates/nav.mustache.template 3 | TOCMENUTEMPLATE = ./support/templates/toc.mustache.template 4 | CONTENTOPFTEMPLATE = ./support/templates/contentopf.mustache.template 5 | TITLEPAGETEMPLATE = ./support/templates/title_page.mustache.template 6 | 7 | .SECONDARY: 8 | 9 | #EPUB 10 | $(OUTPUTDIRECTORY)/%.epub: $(OUTPUTDIRECTORY)/%.content.opf 11 | mkdir -p $(OUTPUTDIRECTORY)/Ibook 12 | cp ./support/ePub_support/Mimetype $(OUTPUTDIRECTORY)/Ibook/ 13 | cp -r ./support/ePub_support/META-INF $(OUTPUTDIRECTORY)/Ibook/ 14 | cp ./support/style/stylesheet.css $(OUTPUTDIRECTORY)/Ibook/ 15 | mv $(OUTPUTDIRECTORY)/$*.xhtml $(OUTPUTDIRECTORY)/Ibook/chapter.xhtml 16 | #Move all the file begining by the outputFile name 17 | bash ./support/scripts/moveFilesToIbook.sh $* $(OUTPUTDIRECTORY)/ 18 | cd $(OUTPUTDIRECTORY)/Ibook/; zip -r ../tmp.zip * 19 | mv $(OUTPUTDIRECTORY)/tmp.zip $@ 20 | rm -r $(OUTPUTDIRECTORY)/Ibook 21 | 22 | #Navigation Menus 23 | $(OUTPUTDIRECTORY)/%.nav.xhtml.json: %.pillar 24 | ./pillar export --to="navmenu" --path="${<}" --outputDirectory=$(OUTPUTDIRECTORY) $< 25 | 26 | $(OUTPUTDIRECTORY)/%.nav.xhtml: $(OUTPUTDIRECTORY)/%.nav.xhtml.json 27 | ./mustache --data=$< --template=$(NAVMENUTEMPLATE) > $@ 28 | 29 | $(OUTPUTDIRECTORY)/%.toc.ncx.json: %.pillar 30 | ./pillar export --to="tocmenu" --path="${<}" --outputDirectory=$(OUTPUTDIRECTORY) $< 31 | 32 | $(OUTPUTDIRECTORY)/%.toc.ncx: $(OUTPUTDIRECTORY)/%.toc.ncx.json 33 | ./mustache --data=$< --template=$(TOCMENUTEMPLATE) > $@ 34 | 35 | #Content.opf & title_page.xhtml 36 | $(OUTPUTDIRECTORY)/%.content.opf: $(OUTPUTDIRECTORY)/%.xhtml $(OUTPUTDIRECTORY)/%.toc.ncx $(OUTPUTDIRECTORY)/%.nav.xhtml $(OUTPUTDIRECTORY)/%.title_page.xhtml 37 | ./mustache --data=$<.json --template=$(CONTENTOPFTEMPLATE) > $@ 38 | 39 | $(OUTPUTDIRECTORY)/%.title_page.xhtml: $(OUTPUTDIRECTORY)/%.xhtml 40 | ./mustache --data=$<.json --template=$(TITLEPAGETEMPLATE) > $@ 41 | 42 | #Chapter compilation 43 | $(OUTPUTDIRECTORY)/%.xhtml.json: %.pillar 44 | ./pillar export --to="xhtml" --path="${<}" --outputDirectory=$(OUTPUTDIRECTORY) $< 45 | 46 | $(OUTPUTDIRECTORY)/%.xhtml: $(OUTPUTDIRECTORY)/%.xhtml.json 47 | ./mustache --data=$< --template=$(XHTMLTEMPLATE) > $@ 48 | -------------------------------------------------------------------------------- /support/makefiles/help.mk: -------------------------------------------------------------------------------- 1 | # Some shell magic to auto-document the main targets. To have a target appear in 2 | # the output, add a short, one-line comment with a double ## on the same line as 3 | # the target. 4 | # 5 | # See http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html 6 | 7 | .phony: help 8 | 9 | help: ## Describe the main targets (this list) 10 | @echo "Main targets you can build:" 11 | @awk -F ':|## *' \ 12 | '/^[^\t].+:.*##/ {\ 13 | printf " \033[36m%s\033[0m#%s\n", $$1, $$NF \ 14 | }' $(MAKEFILE_LIST) \ 15 | | column -s# -t 16 | @[ -n "$(ALTERNATEPRINTFORMATS)" ] \ 17 | && echo "Print format alternatives: pdf $(ALTERNATEPRINTFORMATS)" 18 | @echo "Combined format+volume targets: pdfbook, htmlchapters…" 19 | @echo "To make a single specific file/format, ask for it explicitly:" 20 | @echo " make $(OUTPUTDIRECTORY)/$(firstword $(CHAPTERS)).pdf" 21 | 22 | # Check that given variables are set and all have non-empty values, 23 | # die with an error otherwise. 24 | # 25 | # Params: 26 | # 1. Variable name(s) to test. 27 | # 2. (optional) Error message to print. 28 | # 29 | # See http://stackoverflow.com/questions/10858261/abort-makefile-if-variable-not-set 30 | check_defined = \ 31 | $(strip $(foreach 1,$1, \ 32 | $(call __check_defined,$1,$(strip $(value 2))))) 33 | __check_defined = \ 34 | $(if $(value $1),, \ 35 | $(error Undefined setting $1$(if $2, ($2)))) 36 | -------------------------------------------------------------------------------- /support/makefiles/html.mk: -------------------------------------------------------------------------------- 1 | $(call check_defined, HTMLTEMPLATE, Template for main document in HTML) 2 | $(call check_defined, HTMLCHAPTERTEMPLATE, Template for individual chapters in HTML) 3 | 4 | .phony: html htmlbook htmlchapters html-clean 5 | 6 | html: htmlbook htmlchapters ## Everything HTML 7 | htmlbook: $(OUTPUTDIRECTORY)/$(MAIN).html 8 | htmlchapters: $(CHAPTERS:%=$(OUTPUTDIRECTORY)/%.html) 9 | 10 | clean: html-clean 11 | html-clean: 12 | for f in $(addprefix $(OUTPUTDIRECTORY)/,$(MAIN) $(CHAPTERS)); do \ 13 | rm -f "$$f.html.json" ; \ 14 | done 15 | 16 | $(OUTPUTDIRECTORY)/$(MAIN).html.json: $(CHAPTERS:%=%.pillar) 17 | $(OUTPUTDIRECTORY)/%.html.json: %.pillar | prepare 18 | ./pillar export --to="HTML" --outputDirectory=$(OUTPUTDIRECTORY) --outputFile=$< $< 19 | 20 | $(OUTPUTDIRECTORY)/$(MAIN).html: TEMPLATE = $(HTMLTEMPLATE) 21 | $(CHAPTERS:%=$(OUTPUTDIRECTORY)/%.html): TEMPLATE = $(HTMLCHAPTERTEMPLATE) 22 | $(OUTPUTDIRECTORY)/%.html: $(OUTPUTDIRECTORY)/%.html.json $(TEMPLATE) 23 | ./mustache --data=$< --template=$(TEMPLATE) > $@ 24 | -------------------------------------------------------------------------------- /support/makefiles/pdf.mk: -------------------------------------------------------------------------------- 1 | $(call check_defined, LATEXTEMPLATE, Template for main document in PDF) 2 | $(call check_defined, LATEXCHAPTERTEMPLATE, Template for individual chapters in PDF) 3 | 4 | # List of alternate PDF formats generated from the default TeX and activated via 5 | # the support/latex/*.preamble.tex files. 6 | # 7 | # Define the actual list in the main makefile; this just provides a default list 8 | export ALTERNATEPRINTFORMATS ?= spiral 9 | 10 | .phony: pdf pdfbook pdfchapters pdf-clean 11 | 12 | pdf: pdfbook pdfchapters ## Everything PDF 13 | pdfbook: $(OUTPUTDIRECTORY)/$(MAIN).pdf 14 | pdfchapters: $(CHAPTERS:%=$(OUTPUTDIRECTORY)/%.pdf) 15 | 16 | clean: pdf-clean 17 | pdf-clean: 18 | for f in $(addprefix $(OUTPUTDIRECTORY)/,$(MAIN) $(CHAPTERS)); do \ 19 | latexmk -cd -f -c "$$f" ; \ 20 | rm -f "$$f.tex" "$$f.tex.json" "$$f.d" $$(dirname $$f)/Makefile; \ 21 | done 22 | 23 | # LaTeX sources generation from Pillar & templates 24 | $(OUTPUTDIRECTORY)/$(MAIN).tex.json: $(CHAPTERS:%=%.pillar) 25 | $(OUTPUTDIRECTORY)/%.tex.json: %.pillar | prepare 26 | ./pillar export --to="LaTeX" --outputDirectory=$(OUTPUTDIRECTORY) --outputFile=$< $< 27 | 28 | $(OUTPUTDIRECTORY)/$(MAIN).tex: TEMPLATE = $(LATEXTEMPLATE) 29 | $(CHAPTERS:%=$(OUTPUTDIRECTORY)/%.tex): TEMPLATE = $(LATEXCHAPTERTEMPLATE) 30 | $(OUTPUTDIRECTORY)/%.tex: $(OUTPUTDIRECTORY)/%.tex.json $(TEMPLATE) 31 | ./mustache --data=$< --template=$(TEMPLATE) > $@ 32 | 33 | # Generated rules for each alternate PDF format 34 | define FORMAT_rule 35 | .phony: $(1) $(1)book $(1)chapters $(1)-clean 36 | 37 | $(1): $(1)book $(1)chapters 38 | $(1)book: $$(OUTPUTDIRECTORY)/$$(MAIN).$(1).pdf 39 | $(1)chapters: $$(CHAPTERS:%=$$(OUTPUTDIRECTORY)/%.$(1).pdf) 40 | 41 | clean: $(1)-clean 42 | $(1)-clean: 43 | for f in $$(patsubst %,$$(OUTPUTDIRECTORY)/%.$(1),$$(MAIN) $$(CHAPTERS)); do \ 44 | latexmk -cd -f -c "$$$$f" ; \ 45 | rm -f "$$$$f.tex" "$$$$f.tex.json" "$$$$f.d"; \ 46 | done 47 | 48 | # LaTeX wrapper files for alternate formats 49 | %.$(1).tex: %.tex support/latex/$(1).preamble.tex 50 | @echo '\input{root/support/latex/$(1).preamble}\input{$$(*F)}' > $$@ 51 | endef 52 | $(foreach fmt,$(ALTERNATEPRINTFORMATS),\ 53 | $(eval $(call FORMAT_rule,$(fmt)))) 54 | 55 | # LaTeX compilation via sub-make 56 | # (required because of the paths in the *.d dependency files) 57 | $(OUTPUTDIRECTORY)/%.pdf: $(OUTPUTDIRECTORY)/%.tex 58 | cp support/makefiles/pdf.sub.mk $(@D)/Makefile 59 | make --directory=$(@D) $(@F) 60 | -------------------------------------------------------------------------------- /support/makefiles/pdf.sub.mk: -------------------------------------------------------------------------------- 1 | -include $(wildcard *.d) 2 | 3 | %.pdf: %.tex 4 | latexmk -lualatex -use-make \ 5 | -latexoption="--file-line-error --halt-on-error" \ 6 | -deps-out="$*.d" \ 7 | $< 8 | -------------------------------------------------------------------------------- /support/makefiles/prepare.mk: -------------------------------------------------------------------------------- 1 | $(call check_defined, OUTPUTDIRECTORY, Directory for build products) 2 | $(call check_defined, MAIN, Base name of the main document) 3 | $(call check_defined, CHAPTERS, Base names of the chapters) 4 | 5 | .phony: prepare clean wipeout download prepare-build 6 | 7 | FIGURES := $(shell find . \ 8 | -type f \ 9 | -path '*/figures/*' \ 10 | ! -path './$(OUTPUTDIRECTORY)/*' \ 11 | ! -path './support/*' \ 12 | -print) 13 | 14 | # Install build tools & dependencies, create the build directory structure 15 | prepare: pillar mustache prepare-build 16 | 17 | # wrapper scripts for pillar and mustache are created together from the pillar install script 18 | pillar mustache: | download 19 | download: ## Install Pharo VM & image for Pillar & Mustache 20 | wget --quiet --output-document=- "https://raw.githubusercontent.com/pillar-markup/pillar/master/download.sh" | bash -s $$* 21 | 22 | clean: ## Cleanup intermediate build products 23 | rm -f $(addprefix $(OUTPUTDIRECTORY)/, support gitHeadLocal.gin) 24 | for f in $(addprefix $(OUTPUTDIRECTORY)/,$(MAIN) $(CHAPTERS)); do \ 25 | rm -f "$$(dirname $$f)/root" ; \ 26 | done 27 | 28 | wipeout: ## Cleanup everything including final build products 29 | rm -fr ${OUTPUTDIRECTORY} 30 | 31 | # create & initialize output directory, mirroring stuff that has to match the 32 | # repo hierarchy inside the output dir. 33 | prepare-build: $(addprefix $(OUTPUTDIRECTORY)/, support gitHeadLocal.gin $(FIGURES)) 34 | 35 | $(OUTPUTDIRECTORY): 36 | mkdir -p $(OUTPUTDIRECTORY) 37 | 38 | $(OUTPUTDIRECTORY)/support: $(OUTPUTDIRECTORY) 39 | ln -fs ../support $(OUTPUTDIRECTORY) 40 | 41 | # extract versioning info for LaTeX 42 | $(OUTPUTDIRECTORY)/gitHeadLocal.gin: $(OUTPUTDIRECTORY) 43 | bash support/latex/sbabook/gitinfo2.sh > $@ 44 | 45 | # this is making hardlinks (symlinks are verbose with absolute paths and 46 | # computing relative paths is… complicated) 47 | $(FIGURES:%=$(OUTPUTDIRECTORY)/%): $(OUTPUTDIRECTORY)/% : % 48 | @mkdir -p $(dir $@) 49 | cp $< $@ 50 | -------------------------------------------------------------------------------- /support/scripts/moveFilesToIbook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd $2 3 | for file in $1.*; do target=${file#$1.}; mv $file Ibook/$target; done 4 | cd .. 5 | -------------------------------------------------------------------------------- /support/templates/chapter.latex.mustache: -------------------------------------------------------------------------------- 1 | % -*- mode: latex; -*- mustache tags: {{=« »=}} «! the '&' below prevents HTML escaping. » 2 | \ifx\wholebook\relax\else 3 | 4 | \documentclass[10pt,twoside,english]{root/support/latex/sbabook/sbabook} 5 | \usepackage{import} 6 | \subimport{root/support/latex/}{common.tex} 7 | 8 | \hypersetup{pdfinfo = { 9 | Title = {«& title»}, 10 | Author = {«& attribution»}, 11 | Keywords = {pharo, smalltalk}}} 12 | \begin{document} 13 | \fi 14 | 15 | \chapter{«& title»} 16 | \chapterprecis{«& attribution»} 17 | 18 | «& content» 19 | 20 | \ifx\wholebook\relax\else 21 | \end{document} 22 | \fi -------------------------------------------------------------------------------- /support/templates/contents.opf.mustache: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{{title}}} 5 | urn:uuid:702a038c-b6f0-42b5-8077-deb8da0b4151 6 | en-EN 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /support/templates/html.mustache: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{{title}}} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 28 | 29 | 30 | 31 |
32 |
33 |

{{{title}}}

34 |
{{{attribution}}}
35 | 36 | {{{content}}} 37 |
38 |
39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /support/templates/main.latex.mustache: -------------------------------------------------------------------------------- 1 | % -*- mode: latex; -*- mustache tags: {{=« »=}} «! the '&' below prevents HTML escaping. » 2 | \documentclass[10pt,twoside,english]{root/support/latex/sbabook/sbabook} 3 | \let\wholebook=\relax 4 | 5 | \usepackage{import} 6 | \subimport{root/support/latex/}{common.tex} 7 | 8 | %================================================================= 9 | % Debug packages for page layout and overfull lines 10 | % Remove the showtrims document option before printing 11 | \ifshowtrims 12 | \usepackage{showframe} 13 | \usepackage[color=magenta,width=5mm]{root/support/latex/overcolored} 14 | \fi 15 | 16 | 17 | % ================================================================= 18 | \title{«& title»} 19 | \author{«& attribution»} 20 | \series{«& series»} 21 | \date{\gitdate\titlebreak[\smallskip]{ -- }\protect\gitCommitInfo} 22 | 23 | \hypersetup{ 24 | pdftitle = {«& title»}, 25 | pdfauthor = {«& attribution»}, 26 | pdfkeywords = {«& keywords»} 27 | } 28 | 29 | 30 | % ================================================================= 31 | \begin{document} 32 | 33 | % Title page and colophon on verso 34 | \maketitle 35 | \pagestyle{titlingpage} 36 | \thispagestyle{titlingpage} % \pagestyle does not work on the first one… 37 | 38 | \cleartoverso 39 | {\small 40 | 41 | Copyright 2017 by «& attribution». 42 | 43 | The contents of this book are protected under the Creative Commons 44 | Attribution-ShareAlike 3.0 Unported license. 45 | 46 | You are \textbf{free}: 47 | \begin{itemize} 48 | \item to \textbf{Share}: to copy, distribute and transmit the work, 49 | \item to \textbf{Remix}: to adapt the work, 50 | \end{itemize} 51 | 52 | Under the following conditions: 53 | \begin{description} 54 | \item[Attribution.] You must attribute the work in the manner specified by the 55 | author or licensor (but not in any way that suggests that they endorse you 56 | or your use of the work). 57 | \item[Share Alike.] If you alter, transform, or build upon this work, you may 58 | distribute the resulting work only under the same, similar or a compatible 59 | license. 60 | \end{description} 61 | 62 | For any reuse or distribution, you must make clear to others the 63 | license terms of this work. The best way to do this is with a link to 64 | this web page: \\ 65 | \url{http://creativecommons.org/licenses/by-sa/3.0/} 66 | 67 | Any of the above conditions can be waived if you get permission from 68 | the copyright holder. Nothing in this license impairs or restricts the 69 | author's moral rights. 70 | 71 | \begin{center} 72 | \includegraphics[width=0.2\textwidth]{root/support/latex/sbabook/CreativeCommons-BY-SA.pdf} 73 | \end{center} 74 | 75 | Your fair dealing and other rights are in no way affected by the 76 | above. This is a human-readable summary of the Legal Code (the full 77 | license): \\ 78 | \url{http://creativecommons.org/licenses/by-sa/3.0/legalcode} 79 | 80 | \vfill 81 | 82 | % Publication info would go here (publisher, ISBN, cover design…) 83 | Layout and typography based on the \textcode{sbabook} \LaTeX{} class by Damien 84 | Pollet. 85 | } 86 | 87 | 88 | \frontmatter 89 | \pagestyle{plain} 90 | 91 | \tableofcontents* 92 | \clearpage\listoffigures 93 | 94 | \mainmatter 95 | 96 | «& content» 97 | 98 | % lulu requires an empty page at the end. That's why I'm using 99 | % \backmatter here. 100 | \backmatter 101 | 102 | % Index would go here 103 | 104 | \end{document} 105 | -------------------------------------------------------------------------------- /support/templates/nav.html.mustache: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{{title}}} 5 | 6 | 7 | 8 |
9 |

{{{title}}}

10 |
    11 |
  1. 12 | 13 | {{{title}}} 14 | 15 |
      16 | {{{content}}} 17 |
    18 |
  2. 19 |
20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /support/templates/nav.ncx.mustache: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{{title}}} 11 | 12 | 13 | 14 | 15 | {{{title}}} 16 | 17 | 18 | 19 | 20 | 21 | {{{title}}} 22 | 23 | 24 | {{{content}}} 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /support/templates/no-sectioning.latex.mustache: -------------------------------------------------------------------------------- 1 | % -*- mode: latex; -*- 2 | \ifx\wholebook\relax\else 3 | 4 | \documentclass[10pt,twoside,ustradelulu]{root/support/latex/sbabook/sbabook} 5 | \usepackage{import} 6 | \subimport{root/support/latex/}{common.tex} 7 | 8 | \begin{document} 9 | \fi 10 | 11 | {{=« »=}} 12 | 13 | «! the '&' below prevents HTML escaping. » 14 | «& content» 15 | 16 | \ifx\wholebook\relax\else 17 | \end{document} 18 | \fi -------------------------------------------------------------------------------- /support/templates/title_page.html.mustache: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | {{{title}}} 8 | 9 | 10 | 11 |

{{{title}}}

12 | 13 | 14 | -------------------------------------------------------------------------------- /support/templates/xhtml.mustache: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | {{{title}}} 7 | 8 | 9 | 10 | {{{content}}} 11 | 12 | 13 | --------------------------------------------------------------------------------