diff --git a/README.md b/README.md index fe2d136..e27ceb0 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,11 @@ by [Karl Seguin](https://github.com/karlseguin) into Russian. Distributed under the terms of [Attribution-NonCommercial-ShareAlike 4.0 International](http://creativecommons.org/licenses/by-nc-sa/4.0/) + +# Converting + +## epub + +``` +pandoc --metadata title="..." --syntax-definition="zig.xml" --highlight-style="zig.theme" ch01.md -o ch01.epub +``` diff --git a/src/ch01.md b/src/ch01.md index a478288..17c3b58 100644 --- a/src/ch01.md +++ b/src/ch01.md @@ -162,7 +162,7 @@ fn add(a: i64, b: i64) i64 { } ``` -Программисты, пишущие на языках C или C++, наверняка заметят, что Zig не +Программисты, пишущие на языках C или C++, наверняка заметили, что Zig не требует объявления/определения функции до её использования, функция `add` вызывается раньше (по тексту), чем встречается её определение. diff --git a/src/zig.theme b/src/zig.theme new file mode 100644 index 0000000..67e3f5c --- /dev/null +++ b/src/zig.theme @@ -0,0 +1,211 @@ +{ + "text-color": null, + "background-color": "#f7f7ff", + "line-number-color": "#aaaaaa", + "line-number-background-color": null, + "text-styles": { + "Other": { + "text-color": "#007020", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Attribute": { + "text-color": "#7d9029", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "SpecialString": { + "text-color": "#bb6688", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Annotation": { + "text-color": "#60a0b0", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + }, + "Function": { + "text-color": "#06287e", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "String": { + "text-color": "#4070a0", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "ControlFlow": { + "text-color": "#007020", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Operator": { + "text-color": "#666666", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Error": { + "text-color": "#ff0000", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "BaseN": { + "text-color": "#40a070", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Alert": { + "text-color": "#ff0000", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + }, + "Variable": { + "text-color": "#19177c", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "BuiltIn": { + "text-color": "#0000ff", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Extension": { + "text-color": null, + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Preprocessor": { + "text-color": "#bc7a00", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Information": { + "text-color": "#60a0b0", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + }, + "VerbatimString": { + "text-color": "#4070a0", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Warning": { + "text-color": "#60a0b0", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + }, + "Documentation": { + "text-color": "#ba2121", + "background-color": null, + "bold": false, + "italic": true, + "underline": false + }, + "Import": { + "text-color": null, + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Char": { + "text-color": "#4070a0", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "DataType": { + "text-color": "#902000", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Float": { + "text-color": "#40a070", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Comment": { + "text-color": "#60a0b0", + "background-color": null, + "bold": false, + "italic": true, + "underline": false + }, + "CommentVar": { + "text-color": "#60a0b0", + "background-color": null, + "bold": true, + "italic": true, + "underline": false + }, + "Constant": { + "text-color": "#880000", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "SpecialChar": { + "text-color": "#4070a0", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "DecVal": { + "text-color": "#40a070", + "background-color": null, + "bold": false, + "italic": false, + "underline": false + }, + "Keyword": { + "text-color": "#007020", + "background-color": null, + "bold": true, + "italic": false, + "underline": false + } + } +} diff --git a/src/zig.xml b/src/zig.xml new file mode 100644 index 0000000..31b93aa --- /dev/null +++ b/src/zig.xml @@ -0,0 +1,311 @@ + + + + + + + +]> + + + + addrspace + align + and + anyframe + anytype + asm + callconv + enum + error + export + fn + inline + noalias + nosuspend + noinline + opaque + or + orelse + packed + pub + resume + linksection + struct + suspend + test + union + unreachable + usingnamespace + + + while + try + switch + return + for + if + continue + else + break + catch + defer + errdefer + + + i8 + u8 + i16 + u16 + i32 + u32 + i64 + u64 + i128 + u128 + isize + usize + c_short + c_ushort + c_int + c_uint + c_long + c_ulong + c_longlong + c_ulonglong + c_longdouble + f16 + f32 + f64 + f80 + f128 + bool + anyopaque + void + noreturn + type + anyerror + comptime_int + comptime_float + + + async + await + const + threadlocal + extern + allowzero + comptime + var + volatile + + + false + null + true + undefined + + + @addrSpaceCast + @addWithOverflow + @alignCast + @alignOf + @as + @atomicLoad + @atomicRmw + @atomicStore + @bitCast + @bitOffsetOf + @boolToInt + @bitSizeOf + @breakpoint + @mulAdd + @byteSwap + @bitReverse + @offsetOf + @call + @cDefine + @cImport + @cInclude + @clz + @cmpxchgStrong + @cmpxchgWeak + @compileError + @compileLog + @ctz + @cUndef + @cVaArg + @cVaCopy + @cVaEnd + @cVaStart + @divExact + @divFloor + @divTrunc + @embedFile + @enumToInt + @errorName + @errorReturnTrace + @errorToInt + @errSetCast + @export + @extern + @fence + @field + @fieldParentPtr + @floatCast + @floatToInt + @frameAddress + @hasDecl + @hasField + @import + @intCast + @intToEnum + @intToError + @intToFloat + @intToPtr + @max + @memcpy + @memset + @min + @wasmMemorySize + @wasmMemoryGrow + @mod + @mulWithOverflow + @panic + @popCount + @prefetch + @ptrCast + @ptrToInt + @rem + @returnAddress + @select + @setAlignStack + @setCold + @setEvalBranchQuota + @setFloatMode + @setRuntimeSafety + @shlExact + @shlWithOverflow + @shrExact + @shuffle + @sizeOf + @splat + @reduce + @src + @sqrt + @sin + @cos + @tan + @exp + @exp2 + @log + @log2 + @log10 + @fabs + @floor + @ceil + @trunc + @round + @subWithOverflow + @tagName + @This + @truncate + @Type + @typeInfo + @typeName + @TypeOf + @unionInit + @Vector + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +