diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4ee5f84..1a63e2e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -212,7 +212,8 @@ Unordered list lines should be indented **once**, while ordered lists are indented **twice**. The text of an unordered item should have one space after the `-`, while the text of an ordered item -should start four columns after the number. +should start on the fourth column +(start every line with the number 1). ```md - This is an unordered list @@ -221,11 +222,10 @@ should start four columns after the number. ``` ```md -1. This is an ordered list. - Consecutive lines are indented with four spaces. -2. Another list item +1. This is an ordered list +1. Another list item … -10. Now only one space after the item number. +1. Last entry of the list ``` @@ -362,10 +362,41 @@ and per-page unique number. must all be written one line per footnote. Line breaks **cannot** be used. + +### Mathematics with TeX + +This guide has KaTeX support, +so in-line or block mathematics can be rendered with TeX. +This obviously requires knowledge of TeX syntax and the supported functions +listed in the [KaTeX documentation][]. +To start in-line formulas, the syntax is `$$...$$`. +Similarly, the block formulas' syntax is: + +```md +$$ +... +$$ +``` + +Similar to \`\`\` fenced code blocks, +separate these blocks with one blank line on either side. + +**Note:** both `{% math %}` and `{% endmath %}` templates +can be entirely replaced by two `$`'s, +so any math between \$\$ ... \$\$ will render with KaTeX[^3]. +However, using "\$\$" within in-line \`code\` or blocks +will change these into the templates above +(making printing "\$\$" in code impossible). + +[KaTeX documentation]: https://katex.org/docs/supported.html + --- [^1]: The new gitbook spec is very different than the version this book is using. Almost none of the information from [gitbook's new website][new-gitbook] applies. [^2]: This is different from how github.com's markdown preview behaves. +[^3]: Please view the [markdown of this page][contrib-md] for an example of KaTeX math using `$` symbols. + [new-gitbook]: https://www.gitbook.com/ +[contrib-md]: https://github.com/Irrational-Encoding-Wizardry/guide.encode.moe/edit/master/CONTRIBUTING.md diff --git a/README.md b/README.md index 0224e87..131d032 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,5 @@ # Fansubbing Guide -*This project is not officially published yet. -Please help by improving the articles -and filling in the TODO entries on various pages.* - This project aims to become a public guide for aspiring as well as veteran fansubbers that everyone can contribute to. @@ -11,6 +7,9 @@ It is currently under construction as many topics are still missing, but will hopefully cover all important areas and roles that go into the fansubbing process. +(*Please help by improving the pages +and filling in TODO entries. +More details are provided on the next page.*) To start reading, you can click on the arrow on the right diff --git a/SUMMARY.md b/SUMMARY.md index 7f5fe83..e219b4a 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -19,6 +19,7 @@ - [Descaling](encoding/descaling.md) - [Resampling](encoding/resampling.md) - [Codecs](encoding/video-encoding.md) + - [x264](encoding/codecs/x264.md) ## Typesetting diff --git a/book.json b/book.json index ed7a8f4..dcc4dce 100644 --- a/book.json +++ b/book.json @@ -11,7 +11,8 @@ "code", "edit-link", "image-captions", - "term" + "term", + "katex" ], "pluginsConfig": { "edit-link": { diff --git a/encoding/audio/Fate_Zero_OP2_(original).wav b/encoding/audio/Fate_Zero_OP2_(original).wav new file mode 100644 index 0000000..371f1d0 Binary files /dev/null and b/encoding/audio/Fate_Zero_OP2_(original).wav differ diff --git a/encoding/basics-and-workflow.md b/encoding/basics-and-workflow.md index 86da435..5d75040 100644 --- a/encoding/basics-and-workflow.md +++ b/encoding/basics-and-workflow.md @@ -2,36 +2,584 @@ ## Preparation -downloading a source, looking at the video, some decisions -(resolution(s) for the release, audio codec, group-specific -requirements) +It is important to have a good idea +of what you want the result of the encode +to be like. +What will your video source be? +What resolution should you encode it to? +Do you use AAC or FLAC? +8bit colors or 10bit colors? +All of these are things +that have to be accounted for +and decided early on. +Some groups have set standards. +For example, you may have a group +that always encodes their audio in AAC. +Others will always release their videos in 1080p. +Some may even mix it up +and use FLAC audio for 1080p releases, +but AAC for 720p. +They might even only go for +8bit colors in the latter case! +If you're unsure what standards a group has, +contact your group leader. + +There are various sources +that are often used for the video. +You will most commonly work with websources +like Crunchyroll, +as those are easy to acquire, +or Blu-rays, for the improved quality and fixes. +As a beginner, you might not +have access to private trackers with BDMVs yet. +A good alternative until then +is to use the raws provided by groups like Reinforce: +those that have not been filtered, +just re-encoded from the BDMV. ## Writing the Script -imports, source filter (mention lsmash, ffms2), examples for resizing, -debanding, AA. with images if possible +In order to start filtering, +first you must learn how to write a VapourSynth script. + +```Py +import vapoursynth +core = vs.core +``` + +First, you must import the VapourSynth module. +You can also import various other modules, +like the many "funcs"[^1] that people have written. +Here are some common examples: + +```Py +import kagefunc as kgf +import fvsfunc as fvf +import havsfunc as haf +``` + +These will import various functions +that may prove useful for filtering, +like masks, descaling wrappers, anti-aliasing functions, etc. + +Now, to start filtering, +we must first import a video clip. + +```Py +src = core.ffms2.Source("source") +``` +```Py +src = core.lsmas.LWLibavSource("source") +``` + +There are two common import filters available. +Those are L-SMASH and ffms2. +L-SMASH is typically used for m2ts files +(the kind you'll find in BMDVs), +while ffms2 is used for everything else. +The reason for this is that ffms2 +can't accurately read m2ts files, +which L-SMASH can. +However, L-SMASH is slower than ffms2, +and some people prefer to be able to +index the source files faster. + +It is common practice to call the source clip `src`. +This way it's easy to tell what the original video is, +and it can be referenced for some masks or for comparisons. + +Let's now look at a couple of common filters +that you will find yourself using often. + +```Py +src16 = fvf.Depth(src, 16) +``` + +The color depth of a clip +indicates the number of bits used +to give a pixel its color. +A lot of filters work with high bitdepths, +so this is typically set at the start of the script. +Your average `src` will be 8bit, +but you might occasionally run into 10bit sources as well. + +```Py +trim = core.std.Trim(src, first=100, last=1000) +``` +```Py +trim = src[100:1001] +``` + +`Trim` is used for trimming the video. +It's inclusive, +which means that it also adds the `last` frame given. +Another way to trim is by using Python Slices. +These are exclusive however, +so you need to take that into account. + +Inclusive and exclusive work like this: + +Let's say you have a number range. +This is what they'd look like with both methods: +``` +Inclusive from 1 to 10: +1 2 3 4 5 6 7 8 9 10 + +Exclusive from 1 to 10: +1 2 3 4 5 6 7 8 9 +``` + +Inclusive also **inclu**des +the final number in the given range, +whilst exclusive **exclu**des them. +Both of these have their pros and cons, +so it all comes down to preference. + +```Py +scaled = core.resize.Spline36(src, width=1280, height=720) +``` + +`resize` has multiple "kernels" +that are used for [resampling](resampling.md#upsampling) the clip +to the given resolution. +Common resolutions are 1920x1080, 1600x900, 1280x720, 1024x576 and 848x480. +Nowadays most sources will be available in 1080p, +but there are advantages to downscaling, +like smaller filesizes. + +You will often find grain or noise on a lot of sources. +You can get rid of that by denoising them. + +![Manaria Friends — 04](images/basics_noise.png) + +Look at her hair. There is a lot of grain on there, but some people may prefer that to be smooth instead. + +```Py +import mvsfunc as mvf + +denoise = mvf.BM3D(src, sigma=[4,2]) +``` + +![Manaria Friends — 04 (denoised)](images/basics_denoised.png) + +There are many denoisers available to use, +and they all have their strong and weak points. +Some will have better detail retention, +whilst others are a lot faster. + +Just be aware that getting rid of grain +will often result in more problems popping up, +like the very obvious banding in this case. + +Banding is caused by gradients +breaking up during compression. +In this picture, +you can see the gradient breaking up +very clearly in her hair. +To fix this, you use a debanding filter. + +```Py +import mvsfunc as mvf +import kagefunc as kgf + +denoise = mvf.BM3D(src, sigma=[4,2]) +deband = core.f3kdb.Deband(denoise, range=18, y=40, cb=32, cr=32, grainy=12, grainc=0, output_depth=16) +grain = kgf.adaptive_grain(deband, strength=0.1) +``` +![Manaria Friends — 04 (debanded and grained)](images/basics_debanded.png) + +The banding is now less obvious, +and has been further hidden by adding grain. + +Grain is something that some people like, +and others hate with a passion. +There are various ways that it can be used, +ranging from adding a particular mood to a scene +to preventing other artifacts from showing up. +It's also common for encoders to +add their own grain after denoising. + +![Fairy Tail — NCOP20 (cleaned)](images/basics_clean.png) + +This frame looks fairly clean overall, +but the encoding may introduce some banding +in the darker areas of this frame. +To combat this, we're adding grain +to just the darker areas. + +```Py +import kagefunc as kgf + +grain = kgf.adaptive_grain(deband, strength=0.3, luma_scaling=8) +``` +![Fairy Tail — NCOP20 (grained)](images/basics_grained.png) + + + +Another common issue is aliasing. +Aliasing an artifact that is commonly caused +by scaling or compression. + +![Kimetsu no Yaiba — OP1](images/basics_aliasing.png) + +Note the windows to the left. +You'll want to use anti-aliasing filters +to deal with this. + +```Py +import vsTAAmbk as taa + +aa = taa.TAAmbk(src aatype='Eedi3', opencl=True) +``` + +![Kimetsu no Yaiba - OP1 (anti-aliased)](images/basics_anti-aliased.png) + +There are a couple of different anti-aliasing filters, +some faster than others. +Try out lighter AA if you can first, +like `Nnedi3`. + + ## Encoding the Result -{% term %} -$ vspipe.exe script.vpy -y - | x264.exe --demuxer y4m --some example --parameters here --output video.264 - -{% endterm %} +Now that the filtering has been applied, +it's time to encode the result. +There are two video codecs that are generally accepted nowadays, +and those are AVC/H264 and HEVC/H265. + +For H264 encodes, +you should be using [x264](x264). +For x265, [x265](x265). +Both are also included in ffmpeg, +but for this guide +we will be using the standalone programs. + +There are various settings you will have to tweak +to get your desired results. + +Here's a couple of common settings: +* preset +* keyint +* crf +* aq-strength +* psy-rd +* output-depth +* output-csp + +The preset sets a lot of settings for you. +You'll almost always want to run `--preset veryslow` for anime. + +The keyint sets how often keyframes will be created. +For full episodes those are usually +set to `--min-keyint framerate` and `--keyint framerate*20` or `framerate*30`, +with "framerate" being the framerate of the video. +For example, if your video is 23.976fps (most common for anime), +`min-keyint` would be set to 24 and `keyint` would be set to 480 or 720. + +The **C**onstant **R**ate **F**actor sets the constant quality option. +The default of `--crf 23` is way too low for anime, +and going that high will result in artifacting popping up +more often than not. +For values to use, this varies per encoder. +The commonly suggested values are as follows (lower is better): + +x264: +* 480p: crf 18 or 19 +* 720p: crf 15 or 16 +* 1080p: crf 16 + +x265: +* 480p: +* 720p: +* 1080p: + +How high or low you go will vary depending on the show +and how much you care for the final filesize versus the quality. +Slice of Life anime can usually get away with higher values, +whilst action anime or anime with a lot of darker scenes +benefit from a lower crf. + +aq-strength is a setting that can drastically change the perceived quality. +Higher values do a better job of retaining gradients at the cost of causing ringing, +while lower values preserve edges better at the cost of causing banding. +It is generally adviced to start with `--aq-strength 0.70` +and tweak according to your source. + +psy-rd sets the Psy-RDO and Psy-Trellis. +For an explanation on how it works, read [this doom9 post](psy-rd_post). +For anime you usually go with `--psy-rd 0.72:0`, +and tweak the Psy-RDO settings (first value), +while generally leaving the Psy-Trellis settings (second value) alone. +Higher values can help with better grain retention. + +For newer versions of x264, +it is important to set the `--output-depth 10` flag +when encoding in 10bit colordepth. +Otherwise it will encode in 8bit. +Likewise, when encoding in a 4:4:4 colorspace, +make sure you set `--output-csp i444`. + +With those things in mind, +this is what a common command looks like: ```sh -$ vspipe.exe script.vpy -y - | x264.exe --demuxer y4m --some example --parameters here --output video.264 - +$ vspipe FTOP12.vpy --y4m - | x264 --demuxer y4m -o FTOP12.264 - --preset veryslow --crf 14 --keyint 240 --min-keyint 23 --ref 16 --bframes 16 --aq-mode 3 --aq-strength 0.70 --qcomp 0.70 --no-dct-decimate --no-fast-pskip --psy-rd 0.72:0.0 --output-depth 10 ``` -Editors for VapourSynth usually have inbuilt support for encoding -scripts you wrote. Use `%encode --y4m ` in Yuuno or the GUI -provided by VSEdit. +Editors for VapourSynth usually have inbuilt support +for encoding scripts you wrote. +Use `%encode --y4m ` in Yuuno +or the GUI provided by VSEdit. ## Transcoding Audio -examples for qaac, flac +Before getting into transcoding audio, +it is important to learn about +the difference between +"lossy" and "lossless" compression. + +If you're transcoding in a lossy format, +you are chucking away data +deemed unnecessary by the encoder. +This is the kind of encoding you do with video, +however it can also be done with audio. +The benefit of this is that +you'll end up with smaller files, +however this might cause a reduction in quality. + +Lossless compression is a form of compression where, +upon decoding, none of the data is lost. +This is fantastic for preservation. +However, the results can also turn up +pretty big, very quickly. + +Picking between lossy and lossless encoding +comes down to what you prefer. +Be it having smaller filesizes +with possibly next to no perceivable difference from the original, +or bigger files with as much information as possible. + +You should never encode from a lossy audio codec +to a lossless one, though. +This will only increase the filesize for zero gain. +Likewise, you want to avoid lossy-to-lossy encoding +as much as you possibly can. +The more data you chuck away, +the worse it will sound, +because of [generational loss][generational_loss]. + +There are generally three audio codecs +that you will use: +* FLAC +* AAC +* opus + +FLAC is a **F**ree **L**ossless **A**udio **C**odec. +This is the go-to for lossless audio encoding, +as it's better at compression +than other lossless codecs (like PCM). +You can encode to fLAC using ffmpeg +with the following command: + +`$ ffmpeg -i input.wav output.flac` + +You can also change the compression level. +What this does is that it will try to compress +the audio file even further than with default settings. +However, this will take more resources to encode *and* decode. +Levels range from 0 to 12. + +`$ ffmpeg -i input.wav -compression_level 12 output.flac` + +To show the difference in filesize, +I will use [this](audio/Fate_Zero_OP2_(original).wav) audio file +as an example. +This was ripped straight from the Fate/Zero blu-rays. +The first part is the filesize in bytes, +and the second is the name of the file. +The number in the brackets +indicates the `compression_level` used. + +``` +26.811.464 Fate_Zero_OP2_(original).wav +20.373.919 Fate_Zero_OP2_(00).flac +20.324.721 Fate_Zero_OP2_(01).flac +20.313.009 Fate_Zero_OP2_(02).flac +19.672.150 Fate_Zero_OP2_(03).flac +19.602.556 Fate_Zero_OP2_(04).flac +19.600.585 Fate_Zero_OP2_(05).flac +19.599.423 Fate_Zero_OP2_(06).flac +19.675.564 Fate_Zero_OP2_(07).flac +19.526.067 Fate_Zero_OP2_(08).flac +19.585.149 Fate_Zero_OP2_(09).flac +19.525.085 Fate_Zero_OP2_(10).flac +19.509.644 Fate_Zero_OP2_(11).flac +19.469.016 Fate_Zero_OP2_(12).flac +``` + +The difference between them for something as short as an Opening +isn't that significant, +but that changes +once you start looking at full episodes: + +``` +458.233.964 KaguyaBD_01_(original).wav +314.660.781 KaguyaBD_01_(00).flac +312.773.683 KaguyaBD_01_(01).flac +312.486.815 KaguyaBD_01_(02).flac +300.712.094 KaguyaBD_01_(03).flac +299.806.321 KaguyaBD_01_(04).flac +299.658.920 KaguyaBD_01_(05).flac +299.606.279 KaguyaBD_01_(06).flac +300.119.565 KaguyaBD_01_(07).flac +298.832.315 KaguyaBD_01_(08).flac +299.172.074 KaguyaBD_01_(09).flac +298.773.829 KaguyaBD_01_(10).flac +298.468.836 KaguyaBD_01_(11).flac +297.952.201 KaguyaBD_01_(12).flac +``` + +We can drastically reduce the filesize +by making use of `-sample_fmt s16`. +Not a lot of anime have true 24bit audio, +and the vast majority of people +wouldn't be able to tell a difference regardless. +Some encoders prefer encoding FLAC in 16bit instead +for this very reason. + +``` +458.233.964 KaguyaBD_01_(original).wav +163.088.307 KaguyaBD_01_(00)_16bit.flac +161.313.003 KaguyaBD_01_(01)_16bit.flac +161.051.956 KaguyaBD_01_(02)_16bit.flac +149.929.246 KaguyaBD_01_(03)_16bit.flac +149.084.733 KaguyaBD_01_(04)_16bit.flac +148.909.370 KaguyaBD_01_(05)_16bit.flac +148.857.694 KaguyaBD_01_(06)_16bit.flac +148.848.250 KaguyaBD_01_(07)_16bit.flac +148.149.100 KaguyaBD_01_(08)_16bit.flac +148.088.813 KaguyaBD_01_(09)_16bit.flac +148.080.093 KaguyaBD_01_(10)_16bit.flac +147.368.127 KaguyaBD_01_(11)_16bit.flac +147.327.448 KaguyaBD_01_(12)_16bit.flac +``` + +AAC serves as a fantastic middleground +between FLAC and opus. +AAC is a lossy audio codec, +which results in overall smaller encodes +at the cost of it throwing away some data. + +For encoding in AAC it is always recommended +to use [qaac](qaac) (the Apple AAC encoder) +over the AAC encoder supplied with ffmpeg. +It does a much better job of preserving the perceptional quality +over all its competitors, +and is thus the go-to for people that encode in AAC. + +The options you'll used most is `-V`. +`-V` sets the true Variable Bitrate mode, +allowing qaac free reign in deciding +what it believes to be the best bitrate to encode to. + +The most common command looks like this: + +`$ qaac input.wav -V 127` + +Let's compare the filesizes between the FLAC encodes we did before. + +``` +26.811.464 Fate_Zero_OP2_(original).wav +19.469.016 Fate_Zero_OP2_(12)_24bit.flac +10.898.384 Fate_Zero_OP2_(12)_16bit.flac + 3.886.831 Fate_Zero_OP2_(qaac).m4a +``` +``` +458.233.964 KaguyaBD_01_(original).wav +297.952.201 KaguyaBD_01_(12)_24bit.flac +147.327.448 KaguyaBD_01_(12)_16bit.flac + 54.191.826 KaguyaBD_01_(qaac).m4a +``` + +The final commonly-used audio codec is opus. +Opus is used for web audio, +as it is designed for +low-latency, low-complexity audio compression. +This makes it great for "mini" releases. +You can encode to qaac through ffmpeg: + +`$ ffmpeg -i input.wav output.opus` + +Or through [Opus-tools](opus-tools) +if you don't know +how to compile ffmpeg with opus support: + +`$ opusenc input.wav output.opus` + +Unlike qaac, opus works with a constant bitrate. +You can set it with `-b:a` in ffmpeg +and `--bitrate` in opusenc. +For anime, a bitrate of 128k is usually transparent +for both dialogue and music. + +`$ opusenc input.wav --bitrate 128k output.opus` ## Muxing -mkvtoolnix +The most common tool for muxing is [mkvtoolnix](mkvtoolnix). +It offers an easy-to-use GUI, +as well as CLI for those that prefer that. + +The input tab is where you drag most of your components. +This can be video, audio, and subtitles. +You can also set the languages +and additional settings for every track, +like for example delays, track names, playback fps, etc. + +![mkvtoolnix Input tab](images/basics_mkvtoolnix_input.png) + +The output tab allows you to change the output. +You can for example trim the output, +set the segments, file title, etc. +This is also where you load in the chapters +if your video has any. + +![mkvtoolnix Output tab](images/basics_mkvtoolnix_output.png) + +The attachments tab is where you add attachments +to the output video. +These are generally fonts. + +![mkvtoolnix Attachments tab](images/basics_mkvtoolnix_attachments.png) + +The Chapter Editor allows you to create and edit chapters. +These are used to skip to certain parts of the video, +like for example the Opening. + +![mkvtoolnix Chapters page](images/basics_mkvtoolnix_chapter.png) + +For CLI, you can do a simple mux with the following command: + +`$ mkvmerge -o output.mkv input_video.264 input_audio.m4a` + +For a list of all settings, +check the [documentation](mkvmerge_docs). + +*** + +[^1]: "funcs" are a combination of wrappers written by people to perform different tasks. +Most of these can be found in the [VapourSynth Database][vsdb] + +[vsdb]: http://vsdb.top/ +[generational_loss]: https://en.wikipedia.org/wiki/Generation_loss +[qaac]: https://github.com/nu774/qaac +[opus-tools]: http://www.opus-codec.org/downloads/ +[mkvtoolnix]: https://mkvtoolnix.download/ +[mkvmerge_docs]: https://mkvtoolnix.download/doc/mkvmerge.html +[x264]: https://www.videolan.org/developers/x264.html +[x265]: http://x265.org/ +[psy-rd_post]: https://forum.doom9.org/showthread.php?t=138293 \ No newline at end of file diff --git a/encoding/codecs/x264.md b/encoding/codecs/x264.md new file mode 100644 index 0000000..b3e424f --- /dev/null +++ b/encoding/codecs/x264.md @@ -0,0 +1,325 @@ +# Encoding with x264 + +H.264 has been the de facto standard video format +across the internet for the past decade. +It is widely supported for playback in all modern browsers +and many hardware devices such as gaming consoles and phones. +It provides better video quality at smaller file sizes +compared to its predecessors. + +x264 is a mature, free, open-source encoder +for the H.264 video format. + + +## Prerequisites + +To get started, you'll need two things: + +- A video to encode—for the examples, + we will pipe in a video from VapourSynth, + which you should be able to do + if you've been following the previous sections of this guide +- The x264 encoder + +Here's how we get a copy of the x264 encoder: + + +### Windows + +Official Windows builds are available +[here](https://artifacts.videolan.org/x264/release-win64/). + + +### Linux/macOS + +Generally, x264 will be available +through your distribution's package manager. +Here are a few examples: + +- **Ubuntu/Debian**: `sudo apt install x264` +- **Arch Linux**: `sudo pacman -S x264` +- **macOS**: `brew install x264` + + +## Getting Started + +x264 is very configurable, +and the options may seem overwhelming. +But you can get started encoding +by using the presets x264 provides +and understanding a few basic concepts. +We'll walk through those concepts +with the following examples. + + +### Example 1: General-Purpose Encoding + +Open up a terminal window, +and navigate to the folder +where your VapourSynth script lives. +Let's run the following command: + +``` +vspipe --y4m myvideo.vpy - | x264 --demuxer y4m --preset veryfast --tune animation --crf 24 -o x264output.mkv - +``` + +Let's run through what each of these options means: + + +##### `vspipe --y4m myvideo.vpy -` + +This portion loads your VapourSynth script +and pipes it to stdout, +adding y4m headers that x264 can decode. +If you use Linux, +you're probably familiar with how piping works. +If you're not, +it's basically a way of chaining two commands together. +In this case, we want to chain `vspipe`, +the program that reads VapourSynth scripts, +with `x264`, our encoder. + + +##### `--demuxer y4m` + +This tells x264 that we're providing it with a y4m file. +This matches up with the `--y4m` flag +that we gave to the `vspipe` command. + + +##### `--preset veryfast` + +x264 has a set of presets +to switch between faster encoding, or higher quality. +The full list of presets, from fastest to slowest, is: + +1. ultrafast +1. superfast +1. veryfast +1. faster +1. fast +1. medium +1. slow +1. slower +1. veryslow +1. placebo + +You will almost never want to use the extreme settings, +but generally, if you want good quality +and don't care about how long the encode takes, +`slower` or `veryslow` are recommended. +In this example, +because we are just demonstrating how x264 works, +we want a fast encode and have chosen `veryfast`. + +For the curious, +you can see a full list of the settings enabled by each preset +by running `x264 --fullhelp | less` (Linux/Mac) +or `x264 --fullhelp | more` (Windows). +However, this probably won't mean much at the moment. +Don't worry, +this page will explain later +what all of those settings mean. + +*Disclaimer: +x264's `fullhelp` is not guaranteed to be up-to-date.* + + +##### `--tune animation` + +Beyond the preset chosen, +x264 allows us to further tune the encoding settings +for the type of content we're working with. +The following tunings are generally the most useful: + +- `film`: Recommended for live action videos. +- `animation`: Recommended for anime or cartoons with flat textures. + For 3D animation (e.g. Pixar movies), + you may find better results with `film`. +- `grain`: Recommended for particularly grainy films. + +You don't need to use a tuning, +but it generally helps +to produce a better-looking video. + + +##### `--crf 24` + +CRF is a constant-quality, 1-pass encoding mode. +In layman's terms, +this means that we don't need the output to meet a specific filesize, +we just want the output to meet a certain quality level. +CRF ranges from 0 to 51 (for 8-bit encoding), +with 0 being the best quality +and 51 being the smallest filesize, +but there is a certain range of CRF settings +that are generally most useful. +Here are some guidelines: + +- CRF 13: This is considered visually lossless to videophiles. + This can produce rather large files, + but is a good choice if you want high quality videos. + Some fansubbing groups use this for Blu-ray encodes. +- CRF 16-18: This is considered visually lossless to most viewers, + and leans toward high quality + while still providing a reasonable filesize. + This is a typical range for fansub encodes. +- CRF 21-24: This provides a good balance between quality and filesize. + Some quality loss becomes visible, + but this is generally a good choice + where filesize becomes a concern, + such as for videos viewed over the internet. +- CRF 26-30: This prioritizes filesize, + and quality loss becomes more obvious. + It is generally not recommended to go higher than CRF 30 + in any real-world encoding scenario, + unless you want your videos to look like they were made for dial-up. + + +##### `-o x264output.mkv -` + +This last portion tells which files to use for the input and output. +We use `-o` to tell which filename to write the encoded file to. +In this case, x264 will write a file at `x264output.mkv` +in the current directory. + +The last argument we are passing to x264 is the input file. +In this case, we pass `-` for the input file, +which tells x264 to use the piped output from vspipe. +The input argument is the only positional argument, +so it does not need to be last; +x264 will recognize it +as the only argument without a `--` flag before it. + + +### Example 2: Targeted File Size + +For the next example, +let's say we want to make sure our encode +fits onto a single 4.7GB DVD[^1]. +How would we do that in x264? + +First, we'll need to figure out +what bitrate our encode should be, +in **kilobits per second**. +This means we'll need to know a couple of things: + +- The length of our video, in seconds. + For this example, + let's say our movie is 2 hours (120 minutes) long. + We'll convert that to seconds: + 120 minutes \* 60 minutes/second = **7200 seconds**. +- Our target filesize. + We know that this is 4.7GB, + but we need to convert it to kilobits. + We can do this with the following steps: + +$$ +\begin{aligned} +4.7\:\mathrm{GB}\times \frac{1000\:\mathrm{MB}}{\mathrm{GB}} &= 4700\:\mathrm{MB}\\\\ +4700\:\mathrm{MB}\times \frac{1000\:\mathrm{KB}}{\mathrm{MB}} &= 4,700,000\:\mathrm{KB}\\\\ +4,700,000\:\mathrm{KB}\times \frac{8\:\mathrm{Kbit}}{\mathrm{KB}} &= 37,600,000\:\mathrm{Kbit} +\end{aligned} +$$ + +Now we divide the kilobit size we calculated by our video length, +to find our kilobit per second target bitrate: + +$$ +37,600,000\:\mathrm{Kbit}\div 7200\:\mathrm{seconds} \approx 5222\:\mathrm{Kbps} +$$ + +There is also a [python script][brate_fsize] that can handle this calculation for us: + +```py +>>> from bitrate_filesize import * +>>> find_bitrate('4.7 GB', seconds=7200) +bitrate should be 5,222 kbps +``` + +And here's how we could add that to our x264 command: + +``` +vspipe --y4m myvideo.vpy - | x264 --demuxer y4m --preset veryfast --bitrate 5222 -o x264output.mkv - +``` + +The `--bitrate` option, by itself, +says that we want to do a 1-pass, average-bitrate encode. +In other words, the encoder will still give more bits +to sections of the video that have more detail or motion, +but the average bitrate of the video +will be close to what we requested. + +[brate_fsize]: https://gist.githubusercontent.com/OrangeChannel/816a87cf760d9be19bde18db8818d4bc/raw/bitrate_filesize.py + + +### Example 3: 2-Pass Encoding + +So far, we've only done 1-pass encodes. +While using CRF 1-pass is great +when you don't have a target bitrate, +it's recommended not to use 1-pass +for targeted-bitrate encodes, +because the encoder can't know +what's coming ahead of the current section of video. +This means it can't make good decisions +about what parts of the video need the most bitrate. + +How do we fix this? +x264 supports what is known as 2-pass encoding. +In 2-pass mode, x264 runs through the video twice, +the first time analyzing it +to determine where to place keyframes +and which sections of video need the most bitrate, +and the second time performing the actual encode. +2-pass mode is highly recommended +if you need to target a certain bitrate. + +Here's how we would run our first pass: + +``` +vspipe --y4m myvideo.vpy - | x264 --demuxer y4m --preset veryfast --pass 1 --bitrate 5222 -o x264output.mkv - +``` + +This creates a stats file in our current directory, +which x264 will use in the second pass: + +``` +vspipe --y4m myvideo.vpy - | x264 --demuxer y4m --preset veryfast --pass 2 --bitrate 5222 -o x264output.mkv - +``` + +You'll notice all we had to change was `--pass 1` to `--pass 2`. Simple! + +Although x264 will automatically use faster settings for the first pass, +it should be no surprise +that 2-pass encoding is slower than 1-pass encoding. +Therefore, there are still certain use cases +where 1-pass, bitrate-targeted video +is a good fit, such as streaming. + + +## Recap + +We covered the basics of how to encode in x264, +including speed presets, tunings, and three different encoding modes. + +Here is a summary of when to use each encoding mode: + +- 1-pass Constant Quality (CRF): + - Good for: General-purpose encoding + - Bad for: Streaming; obtaining a certain file size +- 1-pass Average Bitrate: + - Good for: Streaming + - Bad for: Everything else +- 2-pass Average Bitrate: + - Good for: Obtaining a certain file size + - Bad for: Streaming + + +## Advanced Configuration + +Coming Soon + +--- + +[^1]: Source: diff --git a/encoding/descaling.md b/encoding/descaling.md index a698a01..5a97e11 100644 --- a/encoding/descaling.md +++ b/encoding/descaling.md @@ -172,7 +172,7 @@ As a sidenote, it's important to keep in mind that this script can't find native 1080p elements. This is because it descales the frame -and reupscales it afterwards +and re-upscales it afterwards to determine the relative error. You can't descale to 1080p if the frame is already 1080p. @@ -296,7 +296,7 @@ For bicubic, it is important to keep in mind that you will typically find that -the values match the following mathmatical expressions: +the values match the following mathematical expressions: * `b + 2c = 1` * `b = 0, c = X` diff --git a/encoding/images/basics_aliasing.png b/encoding/images/basics_aliasing.png new file mode 100644 index 0000000..dbd1842 Binary files /dev/null and b/encoding/images/basics_aliasing.png differ diff --git a/encoding/images/basics_anti-aliased.png b/encoding/images/basics_anti-aliased.png new file mode 100644 index 0000000..08a374a Binary files /dev/null and b/encoding/images/basics_anti-aliased.png differ diff --git a/encoding/images/basics_clean.png b/encoding/images/basics_clean.png new file mode 100644 index 0000000..3571233 Binary files /dev/null and b/encoding/images/basics_clean.png differ diff --git a/encoding/images/basics_debanded.png b/encoding/images/basics_debanded.png new file mode 100644 index 0000000..7e89529 Binary files /dev/null and b/encoding/images/basics_debanded.png differ diff --git a/encoding/images/basics_denoised.png b/encoding/images/basics_denoised.png new file mode 100644 index 0000000..6c4288b Binary files /dev/null and b/encoding/images/basics_denoised.png differ diff --git a/encoding/images/basics_grained.png b/encoding/images/basics_grained.png new file mode 100644 index 0000000..44eee5e Binary files /dev/null and b/encoding/images/basics_grained.png differ diff --git a/encoding/images/basics_mkvtoolnix_attachments.png b/encoding/images/basics_mkvtoolnix_attachments.png new file mode 100644 index 0000000..fc8484b Binary files /dev/null and b/encoding/images/basics_mkvtoolnix_attachments.png differ diff --git a/encoding/images/basics_mkvtoolnix_chapter.png b/encoding/images/basics_mkvtoolnix_chapter.png new file mode 100644 index 0000000..3db84db Binary files /dev/null and b/encoding/images/basics_mkvtoolnix_chapter.png differ diff --git a/encoding/images/basics_mkvtoolnix_input.png b/encoding/images/basics_mkvtoolnix_input.png new file mode 100644 index 0000000..3cf40f3 Binary files /dev/null and b/encoding/images/basics_mkvtoolnix_input.png differ diff --git a/encoding/images/basics_mkvtoolnix_output.png b/encoding/images/basics_mkvtoolnix_output.png new file mode 100644 index 0000000..43b1626 Binary files /dev/null and b/encoding/images/basics_mkvtoolnix_output.png differ diff --git a/encoding/images/basics_noise.png b/encoding/images/basics_noise.png new file mode 100644 index 0000000..d8fd269 Binary files /dev/null and b/encoding/images/basics_noise.png differ diff --git a/encoding/masking-limiting-etc.md b/encoding/masking-limiting-etc.md index a8af300..799f412 100644 --- a/encoding/masking-limiting-etc.md +++ b/encoding/masking-limiting-etc.md @@ -15,7 +15,7 @@ This article will cover: - Reference clips - Expressions and Lookup Tables - Runtime functions -- Prefiltering +- Pre-filtering ## Masking @@ -61,24 +61,25 @@ where the weights are given by the brightness of the mask clip. The following formula describes these internals for each pixel: -```py -# in 8 bpp, MAX_VALUE would be 255 -output = clipa * (MAX_VALUE - mask) + clipb * mask -``` +$$ +\mathrm{output} = \mathrm{clip\, a} \times (\mathit{max~value} - \mathrm{mask}) + (\mathrm{clip\, b} \times \mathrm{mask}) +$$ + +where *max value* is 255 for 8-bit. In simpler terms: for brighter areas in the mask, -the output will come from `clipb`, +the output will come from **clip b**, and for the dark areas, -it’ll come from `clipa`. -Grey areas result in an average of `clipa` and `clipb`. +it’ll come from **clip a**. +Grey areas result in an average of **clip a** and **clip b**. If `premultiplied` is set to True, the equation changes as follows: -```py -output = clipa * (MAX_VALUE - mask) + clipb -``` +$$ +\mathrm{output} = \mathrm{clip\, a} \times (\mathit{max~value} - \mathrm{mask}) + \mathrm{clip\, b} +$$ [std.MaskedMerge]: http://www.vapoursynth.com/doc/functions/maskedmerge.html @@ -173,7 +174,7 @@ Some commonly used examples would be **Prewitt** (core), **Sobel** (core), and **kirsch** (kagefunc). -There are also some edge detection methods that use prefiltering +There are also some edge detection methods that use pre-filtering when generating the mask. The most common of these would be **TCanny**, which applies a Gaussian blur before creating a 1-pixel-thick Sobel mask. @@ -239,7 +240,7 @@ Fortunately, there is a well-established script that does just that: However, we must be cautious in applying that filter, since, while removing halos reliably, -it’s extremly destructive to the lineart as well. +it’s extremely destructive to the lineart as well. Therefore we must use a **dehalo mask** to protect the lineart and limit the filtering to halos. @@ -294,7 +295,7 @@ mask_inner = vsutil.iterate(mask_outer, core.std.Minimum, 3) ![mask_inner](images/mask_inner0.png) -Now we substract the outer mask covering the halos +Now we subtract the outer mask covering the halos and the lineart from the inner mask covering only the lineart. This yields a mask covering only the halos, which is what we originally wanted: @@ -383,7 +384,7 @@ output = muvf.MergeChroma(output, standard_scale) ## Single and multi-clip adjustments with std.Expr and friends -Vapoursynth's core contains many such filters, +VapourSynth's core contains many such filters, which can manipulate one to three different clips according to a math function. Most, if not all, can be done (though possibly slower) using std.Expr, @@ -400,12 +401,12 @@ integer and float formats, so for more complex filtering float is recommended whenever possible. In 8 bit integer format where neutral luminance (gray) is 128, -the function is `clip1 - clip2 + 128` for MakeDiff -and `clip1 + clip2 - 128` for MergeDiff, +the function is $$\mathrm{clip\, a} - \mathrm{clip\, b} + 128$$ for MakeDiff +and $$\mathrm{clip\, a} + \mathrm{clip\, b} - 128$$ for MergeDiff, so pixels with no change will be gray. The same is true of 16 bit and 32768. -The float version is simply `clip1 - clip2` so in 32 bit +The float version is simply $$\mathrm{clip\, a} - \mathrm{clip\, b}$$ so in 32 bit the difference is defined normally, negative for dark differences, positive for bright differences, @@ -432,9 +433,9 @@ that a constant weight is supplied instead of a mask clip to read the weight from for each pixel. The formula is thus just as simple: -```py -output = clipa * (MAX_VALUE - weight) + clipb * weight -``` +$$ +\mathrm{output} = \mathrm{clip\,a} \times (\mathit{max~value} - \mathrm{weight}) + (\mathrm{clip\,b} \times \mathrm{weight}) +$$ It can be used to perform a weighted average of two clips or planes. @@ -509,7 +510,7 @@ out = core.std.FrameEval(src, partial(scsmooth, clip=src, ref=ref), prop_src=pro ``` -## Prefilters +## Pre-filters TODO [](https://github.com/Irrational-Encoding-Wizardry/guide.encode.moe/edit/master/encoding/masking-limiting-etc.md) diff --git a/encoding/preparation.md b/encoding/preparation.md index 15f243a..5f98030 100644 --- a/encoding/preparation.md +++ b/encoding/preparation.md @@ -29,10 +29,10 @@ If you don't have a reliable way to get raws and if your group doesn't provide them, try finding a source first. Private bittorrent trackers like [u2][] -or [AsianDVDClub][] are good starting points. +or [SkyeySnow][] are good starting points. [u2]: https://u2.dmhy.org "u2" -[AsianDVDClub]: https://asiandvdclub.org "ADC" +[SkyeySnow]: https://skyeysnow.com "SkyeySnow" ## Processing and Filtering @@ -47,12 +47,12 @@ usually based on a script that defines various filters which will be applied to the video. Currently, only two widely-known frameservers exist: -Avisynth and VapourSynth. +AviSynth and VapourSynth. -While many (especially older) encoders still use Avisynth, +While many (especially older) encoders still use AviSynth, there is no reason to use it if you're just starting to learn encoding.[^1] -Most Avisynth users only use it because +Most AviSynth users only use it because they have years of experience and don't want to switch. @@ -60,7 +60,7 @@ Since this guide is aimed towards new encoders, and the author has no qualms about imposing his own opinions onto the host of people willing to listen, the guide will focus on VapourSynth. -Avisynth equivalents are provided for certain +AviSynth equivalents are provided for certain functions where applicable, but the sample code will always be written for VapourSynth. @@ -245,10 +245,17 @@ You can also build it locally from [the public repository][x264vlan-git]. It used to be that different versions, namely kmod and tmod, -were required for certain exclusive encoding features -such as "aq-mode 3". -However, all relevant features have been included in the upstream -x264 builds since August 2018. +were required for certain encoding features +such as `aq-mode 3`. +However, most relevant features have been +added to the upstream x264 builds. +Because of this, kmod is now unmaintained. +tmod is still being updated with changes from new x264 versions, +and it provides some potentially useful parameters such as `--fade-compensate` +or `--fgo` (film grain optimization), as well as additional AQ algorithms +(`aq2-mode`, `aq3-mode`, and parameters for these), +which are generally regarded as useless for almost all sources. +The current tmod release can be downloaded from [the github page][tmod-git-releases]. A newer, more efficient alternative is HEVC, with x265 being the most popular encoder. @@ -270,12 +277,13 @@ The same is true for experimental codecs like [Daala][] and [AV-1][]. Encoders made for distributed server encoding, such as Intel's [SVT-AV1][] will also not be included. -[x264vlan]: https://download.videolan.org/pub/videolan/x264/binaries/ -[x264vlan-git]: https://git.videolan.org/?p=x264.git;a=summary +[x264vlan]: https://artifacts.videolan.org/x264/ +[x264vlan-git]: https://code.videolan.org/videolan/x264 +[tmod-git-releases]: https://github.com/jpsdr/x264/releases [Daala]: https://xiph.org/daala/ [AV-1]: https://aomediacodec.github.io/av1-spec/ [SVT-AV1]: https://github.com/OpenVisualCloud/SVT-AV1 -[unification-commit]: https://git.videolan.org/?p=x264.git;a=commit;h=71ed44c7312438fac7c5c5301e45522e57127db4 +[unification-commit]: https://code.videolan.org/videolan/x264/commit/71ed44c7 ## Audio @@ -291,7 +299,7 @@ in the form of either DTS-HD Master Audio, Dolby TrueHD, or PCM. DTS-HD MA and Dolby THD are proprietary codecs that use lossless compression, while PCM is simply raw, uncompressed PCM data. The usual way to handle these -is to reencode them to other formats—either lossless or lossy, +is to re-encode them to other formats—either lossless or lossy, depending on your taste. But first, you need to decode them. The recommended tool for that is FFmpeg. @@ -299,13 +307,13 @@ You can find Windows builds and Linux packages on [FFmpeg's official site][ffmpeg]. It doesn't need to be installed—you can just extract it somewhere. But, since it is useful for many different tasks, -adding it to the system PATH is recommeded. +adding it to the system PATH is recommended. When working with WEB and TV sources, you will most likely have only lossy audio available. The most common codecs here are AC-3, E-AC-3 and AAC. Lossily compressed files should generally -not be reencoded—the proper way to handle them +not be re-encoded—the proper way to handle them is to remux (i.e. copy) them to the final file. [ffmpeg]: https://www.ffmpeg.org/download.html @@ -399,4 +407,4 @@ due to its versatility and compatibility. --- -[^1]: It should be noted that the author strongly disagrees with this sentiment. The two have a lot in common, and any capable Avisynth encoder could reach a similar level in Vapoursynth within a few months, maybe even weeks. At least I'm honest, okay? +[^1]: It should be noted that the author strongly disagrees with this sentiment. The two have a lot in common, and any capable AviSynth encoder could reach a similar level in Vapoursynth within a few months, maybe even weeks. At least I'm honest, okay? diff --git a/encoding/resampling.md b/encoding/resampling.md index a3bcdb4..f5ae756 100644 --- a/encoding/resampling.md +++ b/encoding/resampling.md @@ -57,7 +57,7 @@ a back-up is available [here][kernels]. [kernels]: http://maven.whatbox.ca:11665/resample_kernels/kernels.html -#### Box filter / Nearest Neigbour +#### Box filter / Nearest Neighbour When upscaling, the Box filter will behave just like @@ -145,7 +145,7 @@ because it is usually considered a good neutral default. It takes two parameters, B and C, which can be used to tweak the filter’s behaviour. For upscaling, it is recommended to use values that satisfy the equation -``b + 2c = 1``. +$$\mathrm{b} + 2\mathrm{c} = 1$$. The graph below outlines the various kinds of artifacts @@ -159,7 +159,7 @@ and raising C will cause ringing. Mitchell-Netravali generalizes all smoothly fitting (continuous first derivative) piece-wise cubic filters, -so any of them can be expressed with the appropiate parameters. +so any of them can be expressed with the appropriate parameters. Below you can find a list of common cubic filters and their corresponding parameters in Mitchell-Netravali. @@ -217,20 +217,20 @@ clip = core.resize.Lanczos(src, w, h, filter_param_a=2) Spline is another high-quality resizer. Spline, like Lanczos, -can be finetuned by configuring its number of lobes. +can be fine-tuned by configuring its number of lobes. Unlike Lanczos, however, Splines with different tap counts are usually split -into seperate functions, -with ``(tap_count∗2)^2`` appended to their name, +into separate functions, +with $$(\mathrm{tap~count} \times 2)^2$$ appended to their name, e.g. Spline36 for 3 taps, Spline64 for 4, etc. -(This number repesents the total amount of input pixels +(This number represents the total amount of input pixels involved in the calculation of any given output pixel.) Spline36 is a very popular choice for downscaling, since it is fairly artifact-free yet decently sharp. For upscaling, -it looks similiar to Lanczos3, +it looks similar to Lanczos3, though arguably slightly less artifacted. VS example: @@ -304,7 +304,7 @@ and Triangle/Bilinear. This can be a beneficial property in some cases, for example the No-Op case. -No-Op means that no scaling, shifting or similiar is performed, +No-Op means that no scaling, shifting or similar is performed, that is, the input is resampled at exactly the same positions. In this case, an interpolation filter will return the input image untouched, @@ -324,13 +324,13 @@ There are two different ways to go about resampling in two dimensions. -#### Tensor resampling (*orthogonal*, *2-pass*, *seperated*) +#### Tensor resampling (*orthogonal*, *2-pass*, *separated*) -The image is resampled in two seperate passes: +The image is resampled in two separate passes: First it is resampled horizontally, then vertically. This allows images to be treated 1-dimensionally -since each pixel row/column can be resampled seperately. -The main advantage of this method is that it's extremly fast, +since each pixel row/column can be resampled separately. +The main advantage of this method is that it's extremely fast, which is why it’s the much more common one; generally, unless indicated otherwise, this is what is used. @@ -340,9 +340,9 @@ this is what is used. ![Two-dimensional kernel. The radius is colored green.](images/resample_polar.png) -All input samples whose [Euclidian distance][L2] to the pixel +All input samples whose [Euclidean distance][L2] to the pixel is within the filter’s radius contribute to its value. -The Euclidian distance is passed to the filter kernel. +The Euclidean distance is passed to the filter kernel. This is a lot more costly than tensor resampling in terms of runtime. [L2]: https://en.wikipedia.org/wiki/Euclidean_distance @@ -436,7 +436,7 @@ introduced by upscaling, you can resize through a sigmoidized colorspace. This means converting the linear RGB version of an image -to a custom colorspace with an S-shaped intensitiy curve +to a custom colorspace with an S-shaped intensity curve before scaling and converting it back afterwards. What this does, essentially, is decrease the image’s contrast @@ -593,11 +593,21 @@ before calculating the output samples. This way, the left-alignment is restored. -This quarter-pixel shifting is performed +Similarly, +when resizing left-aligned 4:2:0 material +while keeping the subsampling, +a slight shift needs to be applied +to preserve the alignment. +Specifically, +the chroma needs to be shifted by +$$0.25 - 0.25 \times \frac{\mathrm{src~width}}{\mathrm{dst~width}}$$.[^4] + +Chroma shifting is performed automatically under the hood by most format conversion software +(including zimg, VapourSynth’s resizing library) and media players. Thus, we only need to take care of it -if we handle the chroma upscaling seperately by hand. +if we handle the chroma upscaling separately by hand. In VS, shifting can be performed with the ``resize`` functions’ ``src_left`` parameter: @@ -611,8 +621,9 @@ shifted_scaled_u = core.resize.Spline16(u, 1920, 1080, src_left=0.25) # shifts t --- -[^1]: The Fourier transform is an ubiqitous concept in image processing, so we strongly advise becoming familiar with at least the basics. A very good resource for this topic is [ImageMagick’s guide][]. +[^1]: The Fourier transform is an ubiquitous concept in image processing, so we strongly advise becoming familiar with at least the basics. A very good resource for this topic is [ImageMagick’s guide][]. [^2]: Robidoux, N. (2012, October 21). Resampling — ImageMagick v6 Examples. Retrieved August 22, 2019, from https://www.imagemagick.org/Usage/filter/nicolas/#upsampling [^3]: If you don’t understand what this means, read the resources linked above in the [resizing section](#resizing). +[^4]: This is derived as follows: The shift is the distance between the position of the first luma sample and the position of the first chroma sample (both mapped onto the input grid and given in terms of input chroma pixel widths). The former is located at $$0.25 + \frac{\mathrm{src~width}}{4 \times \mathrm{dst~width}}$$, the latter at $$\frac{\mathrm{src~width}}{2 \times \mathrm{dst~width}}$$. This yields $$0.25 + \frac{\mathrm{src~width}}{4 \times \mathrm{dst~width}} - \frac{\mathrm{src~width}}{2 \times \mathrm{dst~width}} = 0.25 + \frac{\mathrm{src~width}}{\mathrm{dst~width}} \times \left( ^1/_4 -\,^1/_2 \right) = 0.25 + \frac{\mathrm{src~width}}{\mathrm{dst~width}} \times (-0.25)$$ for the shift. [ImageMagick’s guide]: http://www.fmwconcepts.com/imagemagick/fourier_transforms/fourier.html diff --git a/encoding/video-artifacts.md b/encoding/video-artifacts.md index 959b622..cdeb04e 100644 --- a/encoding/video-artifacts.md +++ b/encoding/video-artifacts.md @@ -127,7 +127,7 @@ are the only two options. Due to with its many flat areas and smooth gradients, banding is a frequent problem in anime, -which is caused by caused by the limits of 8-bit color depth +which is caused by the limits of 8-bit color depth and (especially in low bitrate sources) truncation. The filter GradFun3 is the most common tool for removing it, and is the right tool for the job in average cases. @@ -204,7 +204,7 @@ stubborn ringing in H.264 encodes. In these cases, a simple smoothing based edge-scrubber like HQDeringmod, or a warpsharp-based scrubber *similar to* EdgeCleaner -it has a shitty mask) should all work just fine +(it has a shitty mask) should all work just fine without too many drawbacks. In the case of heavily compressed H.264 sources, @@ -311,8 +311,8 @@ simply adjust the `min/max_in/out` parameters accordingly. [^3]: Blocking may also occur for other reasons other than compression data loss. [Image re-construction with padding][waifu2x238] can cause very similar looking effects, although this is irrelevant for fansubbing source videos. -[^4]: The 8-bit limited range (used in rec.601 and rec.709) (and also BT.2020/2100) only defines values within \[16,235\] for the Y and \[16,240\] for the U and V planes. This means that Y=16 is considered full black and Y=235 full white, while any values outside of that range are clamped virtually (during rendering). U and V behave analogously. +[^4]: The 8-bit limited range (used in rec.601 and rec.709) (and also BT.2020/2100) only defines values within $$[16,~235]$$ for the Y and $$[16,~240]$$ for the U and V planes. This means that Y=16 is considered full black and Y=235 full white, while any values outside of that range are clamped virtually (during rendering). U and V behave analogously. -[^5]: The limited ranges in different precisions are shifted by (multiplied by 2 to the power of) the added bits. For 12-bit, for example, you muliply by 2\^(12-8), resulting in \[256,3760\] and \[256-3840\] respectively. The maximum value in full range is obviously the highest unsigned integer value, so 2\*\*12-1. +[^5]: The limited ranges in different precisions are shifted by (multiplied by 2 to the power of) the added bits. For 12-bit, for example, you multiply by $$2^{12-8}$$, resulting in $$[256,~3760]$$ and $$[256,~3840]$$ respectively. The maximum value in full range is obviously the highest unsigned integer value, so $$2^{12}-1$$. [waifu2x238]: https://github.com/nagadomi/waifu2x/issues/238 diff --git a/overview/requirements.md b/overview/requirements.md index 3d7b324..9d15a8e 100644 --- a/overview/requirements.md +++ b/overview/requirements.md @@ -12,6 +12,7 @@ But you will still need to communicate with the other members of your chosen fansub group, and a language barrier can make that difficult. + ### Hardware Every fansubber will need a computer. @@ -76,6 +77,7 @@ Probably, but it could make your job much harder than it needs to be. to retain these files for a long time. - **Internet**: 25 Mbps download, 25 Mbps upload + ### Software Every role will have different required software, @@ -92,6 +94,7 @@ More specifics will be presented in the chapters devoted to each role. + ### Programming Prior knowledge of some programming languages diff --git a/overview/roles.md b/overview/roles.md index f05353c..cfb5f9c 100644 --- a/overview/roles.md +++ b/overview/roles.md @@ -68,7 +68,9 @@ The entrance and exit times of the subtitles, or a fluid transition from one line to the next, can make a large impact on the "watchability" of the episode as a whole. Take, for example, -[this clip from Eromanga-sensei](https://www.youtube.com/watch?v=DFYvoGVFfX4). +the following clip from Eromanga-sensei: + +
On the left are the official subtitles from Amazon's AnimeStrike, and on the right is a fansub release. @@ -111,8 +113,10 @@ have to deal with. It is *static*, meaning it does not move, and has plenty of room around it to place the translation. Other signs will be much more difficult. -Take for example [this scene from Kobayashi-san Chi no -Maid Dragon](https://www.youtube.com/watch?v=4BVgygZe7WY). +Take for example this scene from Kobayashi-san Chi no +Maid Dragon: + +
Though it may be hard to believe, the typesetting on the right side of the screen was done entirely diff --git a/privacy-policy.md b/privacy-policy.md index d8c0294..5f26f2f 100644 --- a/privacy-policy.md +++ b/privacy-policy.md @@ -1,7 +1,7 @@ # Privacy Policy 1. This page does not store any of your data by itself. -2. We are using the services of CloudFlare. +1. We are using the services of CloudFlare. [CloudFlare Privacy Policy][] @@ -10,12 +10,12 @@ We are using extensions provided by CloudFlare that detects your browser version and injects additional content if you are using an outdated browser. -3. This project is hosted on GitHub. +1. This project is hosted on GitHub. [GitHub Privacy Policy][] GitHub may store information about your visit in the form of log files. - Read the privacy policy of GitHub for furhter information. + Read the privacy policy of GitHub for further information. [CloudFlare Privacy Policy]: https://www.cloudflare.com/privacypolicy/ [GitHub Privacy Policy]: https://help.github.com/en/articles/github-privacy-statement diff --git a/styles/website.css b/styles/website.css index f4201fe..288733b 100644 --- a/styles/website.css +++ b/styles/website.css @@ -1,581 +1,1718 @@ -/* re-overwrite font-size: inherit */ -.markdown-section sup, -.markdown-section sub { +/*! normalize.css v2.1.0 | MIT License | git.io/normalize */ +article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary { + display: block +} +audio,canvas,video { + display: inline-block +} +audio:not([controls]) { + display: none; + height: 0 +} +[hidden] { + display: none +} +html { + font-family: san-serif; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100% +} +body,figure { + margin: 0 +} +a:focus { + outline: thin dotted +} +a:active,a:hover { + outline: 0 +} +h1 { + font-size: 2em; + margin: .67em 0 +} +abbr[title] { + border-bottom: 1px dotted +} +b,strong { + font-weight: 700 +} +dfn { + font-style: italic +} +hr { + -moz-box-sizing: content-box; + box-sizing: content-box; + height: 0 +} +mark { + background: #ff0; + color: #000 +} +code,kbd,pre,samp { + font-family: monospace,serif; + font-size: 1em +} +pre { + white-space: pre-wrap +} +q { + quotes: "\201C" "\201D" "\2018" "\2019" +} +small { + font-size: 80% +} +sub,sup { font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline } - -/* fix vertical anchor alignment */ -a.plugin-anchor { - top: -3px; +sup { + top: -.5em } - -/* make links distinguishable in theme-1 */ -.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a { - color: #d11a4e; +sub { + bottom: -.25em } - -/* fix hr being invisible in theme-1 */ -.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr { - background-color: rgb(112, 66, 20); +img { + border: 0 +} +svg:not(:root) { + overflow: hidden +} +fieldset { + border: 1px solid silver; + margin: 0 2px; + padding: .35em .625em .75em +} +legend { + border: 0; + padding: 0 +} +button,input,select,textarea { + font-family: inherit; + font-size: 100%; + margin: 0 +} +button,input { + line-height: normal +} +button,select { + text-transform: none +} +button,html input[type=button],input[type=reset],input[type=submit] { + -webkit-appearance: button; + cursor: pointer +} +button[disabled],html input[disabled] { + cursor: default +} +input[type=checkbox],input[type=radio] { + box-sizing: border-box; + padding: 0 +} +input[type=search] { + -webkit-appearance: textfield; + -moz-box-sizing: content-box; + -webkit-box-sizing: content-box; + box-sizing: content-box +} +input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration { + -webkit-appearance: none +} +button::-moz-focus-inner,input::-moz-focus-inner { + border: 0; + padding: 0 +} +textarea { + overflow: auto; + vertical-align: top +} +table { + border-collapse: collapse; + border-spacing: 0 +} +.link-inherit { + color: inherit +} +.link-inherit:focus,.link-inherit:hover { + color: inherit +} +.hidden { + display: none +} +.alert { + padding: 15px; + margin-bottom: 20px; + color: #444; + background: #eee; + border-bottom: 5px solid #ddd +} +.alert-success { + background: #dff0d8; + border-color: #d6e9c6; + color: #3c763d +} +.alert-info { + background: #d9edf7; + border-color: #bce8f1; + color: #31708f +} +.alert-danger { + background: #f2dede; + border-color: #ebccd1; + color: #a94442 +} +.alert-warning { + background: #fcf8e3; + border-color: #faebcc; + color: #8a6d3b +} +/*! + * Font Awesome 4.6.3 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */ +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0) + } + to { + -webkit-transform: rotate(359deg); + transform: rotate(359deg) + } } - -/* fix theme-2 nav items being bold for no reason */ -.book.color-theme-2 .book-summary ul.summary li a, -.book.color-theme-2 .book-summary ul.summary li a:hover, -.book.color-theme-2 .book-summary ul.summary li.active > a { - font-weight: normal; +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0) + } + to { + -webkit-transform: rotate(359deg); + transform: rotate(359deg) + } } - -/* website header fade-in fade-out */ -.book-header h1 { - transition: opacity 0.15s ease; +@font-face { + font-family:FontAwesome;src:url(fonts/fontawesome/fontawesome-webfont.eot?v=4.6.3);src:url(fonts/fontawesome/fontawesome-webfont.eot?#iefix&v=4.6.3) format('embedded-opentype'),url(fonts/fontawesome/fontawesome-webfont.woff2?v=4.6.3) format('woff2'),url(fonts/fontawesome/fontawesome-webfont.woff?v=4.6.3) format('woff'),url(fonts/fontawesome/fontawesome-webfont.ttf?v=4.6.3) format('truetype'),url(fonts/fontawesome/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular) format('svg');font-weight:400;font-style:normal +} +.pull-left { + float: left +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0,0,0,0); + border: 0 +} +.sr-only-focusable:active,.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto +} +/*! + * Preboot v2 + * + * Open sourced under MIT license by @mdo. + * Some variables and mixins from Bootstrap (Apache 2 license). + */ +.book-langs-index { + width: 100%; + height: 100%; + padding: 40px 0; + margin: 0; + overflow: auto +} +@media (max-width:600px) { + .book-langs-index { + padding: 0 + } } - -/* header buttons transition styling */ -.book-header .btn:hover { - transition: all 150ms ease; +.book-langs-index .inner { + max-width: 4000px; + width: 100%; + margin: 0 auto; + padding: 30px; + background: #fff; + border-radius: 3px +} +.book-langs-index .inner h3 { + margin: 0 +} +.book-langs-index .inner .languages { + list-style: none; + padding: 20px 30px; + margin-top: 20px; + border-top: 1px solid #eee +} +.book-langs-index .inner .languages:after,.book-langs-index .inner .languages:before,.buttons:after,.buttons:before,.dropdown-menu .buttons:after,.dropdown-menu .buttons:before { + content: " "; + display: table; + line-height: 0 +} +.book-langs-index .inner .languages:after,.buttons:after,.dropdown-menu .buttons:after { + clear: both +} +.book-langs-index .inner .languages li { + width: 50%; + float: left; + padding: 10px 5px; + font-size: 16px +} +@media (max-width:600px) { + .book-langs-index .inner .languages li { + width: 100%; + max-width: 100% + } +} +.book-header { + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + overflow: visible; + height: 50px; + padding: 0 8px; + z-index: 2; + font-size: .85em; + color: #7e888b; + background: 0 0 } -.dropdown-menu .buttons .button:focus, -.dropdown-menu .buttons .button:hover { - transition: all 150ms ease; +.book-header .btn { + display: block; + height: 50px; + padding: 0 15px; + border-bottom: none; + text-transform: uppercase; + line-height: 50px; + -webkit-box-shadow: none!important; + box-shadow: none!important; + position: relative; + font-size: 14px } - -/* summary panel themes and transitions */ -.book-summary ul.summary li a:hover { +.book-header .btn:hover { + position: relative; text-decoration: none; - box-shadow: 0px 2px 5px 1px rgba(0, 0, 0, 0.2); + background: 0 0 } -.book-summary ul.summary li.active > a { - box-shadow: 0px 2px 5px 1px rgba(0, 0, 0, 0.2); +.book-header .btn:focus,.dropdown-menu .buttons .button:focus,.dropdown-menu .buttons .button:hover { + outline: 0 } - -/* styling */ -kbd { - background-color: rgb(250, 251, 252); - border-radius: 3px; - border: rgb(209, 213, 218) solid 1px; - box-shadow: rgb(198, 203, 209) 0px -1px 0px 0px inset; - color: rgb(69, 74, 80); +.book-header h1 { + margin: 0; + font-size: 20px; + font-weight: 200; + text-align: center; + line-height: 50px; + opacity: 0; + padding-right: 200px; + -webkit-transition: opacity .2s ease; + -moz-transition: opacity .2s ease; + -o-transition: opacity .2s ease; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap +} +.book-header h1 a,.book-header h1 a:hover { + color: inherit; + text-decoration: none +} +@media (max-width:1000px) { + .book-header h1 { + display: none + } +} +#book-search-results .search-results,.book-header h1 i,.book.is-loading .book-header h1 a,body.with-search .navigation { + display: none +} +.book-header:hover h1 { + opacity: 1 +} +.book.is-loading .book-header h1 i,h1:hover a.plugin-anchor,h2:hover a.plugin-anchor,h3:hover a.plugin-anchor,h4:hover a.plugin-anchor,h5:hover a.plugin-anchor,h6:hover a.plugin-anchor { + display: inline-block +} +.dropdown,h1,h2,h3,h4,h5,h6 { + position: relative +} +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 100; + display: none; + float: left; + min-width: 160px; + padding: 0; + margin: 2px 0 0; + list-style: none; + font-size: 14px; + border: 1px solid rgba(0,0,0,.07); + -webkit-box-shadow: 0 6px 12px rgba(0,0,0,.175); + background-clip: padding-box +} +.dropdown-menu.open,pre.term span.t-line { + display: block +} +.dropdown-menu.dropdown-left { + left: auto; + right: 4% +} +.dropdown-menu.dropdown-left .dropdown-caret { + right: 14px; + left: auto +} +.dropdown-menu .dropdown-caret { + position: absolute; + top: -8px; + left: 14px; + width: 18px; + height: 10px; + float: left; + overflow: hidden +} +.dropdown-menu .dropdown-caret .caret-inner,.dropdown-menu .dropdown-caret .caret-outer { + position: absolute; display: inline-block; - font-size: 0.9em; - font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, - monospace; - font-weight: 400; - padding: 0.07em 0.3em; - line-height: 1em; - vertical-align: middle; + border-left: 9px solid transparent; + border-right: 9px solid transparent } - -/* non-theme styling */ -.book-summary ul.summary li a, -.book-summary ul.summary li span { - transition: box-shadow 75ms ease; +.dropdown-menu .dropdown-caret .caret-outer { + border-bottom: 9px solid rgba(0,0,0,.1); + height: auto; + left: 0; + width: auto; + margin-left: -1px; + top: 0 } -.book-header .btn, -.navigation { - transition: all 150ms ease; +.dropdown-menu .dropdown-caret .caret-inner { + margin-top: -1px; + top: 1px +} +.dropdown-menu .buttons { + border-bottom: 1px solid rgba(0,0,0,.07) +} +.dropdown-menu .buttons:last-child { + border-bottom: none } .dropdown-menu .buttons .button { - transition: color 150ms ease; + border: 0; + background-color: transparent; + width: 100%; + text-align: center; + float: left; + line-height: 1.42857143; + padding: 8px 4px } - -/* copy code button styling */ -.code-wrapper i { - color: inherit; - font-size: 0.9em; - opacity: 0.5; - transition: all 150ms ease; +.dropdown-menu .buttons .button.size-2 { + width: 50% } -.fa.fa-clone.t-copy:hover { - opacity: 1; +.dropdown-menu .buttons .button.size-3 { + width: 33% } - -/* term plug-in copy code button alignment*/ -pre.term > button.t-copy, -pre.term > i.t-copy { - margin-top: 0px; -} - -/* theme-0 and base attributes */ -/* page background */ -.book-body, -.markdown-section, -.normal.markdown-section { - background-color: #ffffff; - color: #0c0c0c; -} - -/* sidebar background color */ .book-summary { - background-color: #f2f2f2; + position: absolute; + top: 0; + left: -300px; + bottom: 0; + z-index: 1; + overflow-y: auto; + width: 300px; + color: #364149; + background: #fafafa; + border-right: 1px solid rgba(0,0,0,.07); + -webkit-transition: left 250ms ease; + -moz-transition: left 250ms ease; + -o-transition: left 250ms ease; + transition: left 250ms ease +} +.book-summary ul.summary { + list-style: none; + margin: 0; + padding: 0; + -webkit-transition: top .5s ease; + -moz-transition: top .5s ease; + -o-transition: top .5s ease; + transition: top .5s ease +} +.book-summary ul.summary li { + list-style: none } - -/* sidebar subchapter text color */ -.book-summary ul.summary li a, -.book-summary ul.summary li span, -.book-summary ul.summary li.active > a { - color: #0c0c0c; +.book-summary ul.summary li.header { + padding: 20px 15px 10px; + text-transform: uppercase } - -/* sidebar divider bar color */ .book-summary ul.summary li.divider { - background-color: #d8d8d8; + height: 1px; + margin: 7px 0; + overflow: hidden; + background: rgba(0,0,0,.07); + background-color: #d8d8d8 +} +.book-summary ul.summary li i.fa-check { + display: none; + position: absolute; + right: 9px; + top: 16px; + font-size: 9px; + color: #3c3 +} +.book-summary ul.summary li.done>a { + color: #364149; + font-weight: 400 +} +.book-summary ul.summary li.done>a i { + display: inline +} +.book-summary ul.summary li a,.book-summary ul.summary li span { + display: block; + padding: 10px 15px; + border-bottom: none; + background: 0 0; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + position: relative; + transition: box-shadow 75ms ease } - -/* sidebar header formatting */ -.book-summary ul.summary li.header { - color: #8f8f8f; - padding-top: 32px; /* base attr */ - padding-bottom: 7px; /* base attr */ +.book-summary ul.summary li a:focus { + outline: 0 } - -li.header:nth-child(1) { - padding-top: 15px !important; /* uppermost header shouldn't have huge top padding */ +.book-summary ul.summary li.active>a { + background: 0 0; + text-decoration: none +} +.book-summary ul.summary li ul { + padding-left: 20px +} +@media (max-width:600px) { + .book-summary { + width: calc(100% - 60px); + bottom: 0; + left: -100% + } +} +.book.with-summary .book-summary { + left: 0 +} +.book.without-animation .book-summary { + -webkit-transition: none!important; + -moz-transition: none!important; + -o-transition: none!important; + transition: none!important +} +.book { + position: relative; + width: 100%; + height: 100% +} +@media (min-width:600px) { + .book.with-summary .book-body { + left: 300px + } +} +@media (max-width:600px) { + .book.with-summary { + overflow: hidden + } + .book.with-summary .book-body { + -webkit-transform: translate(calc(100% - 60px),0); + -moz-transform: translate(calc(100% - 60px),0); + -ms-transform: translate(calc(100% - 60px),0); + -o-transform: translate(calc(100% - 60px),0); + transform: translate(calc(100% - 60px),0) + } +} +.book.without-animation .book-body { + -webkit-transition: none!important; + -moz-transition: none!important; + -o-transition: none!important; + transition: none!important +} +.book-body { + background: #fff; + -webkit-transition: left 250ms ease; + -moz-transition: left 250ms ease; + -o-transition: left 250ms ease; + transition: left 250ms ease +} +.book-body,.book-body .body-inner { + position: absolute; + top: 0; + right: 0; + left: 0; + bottom: 0; + overflow-y: auto +} +@media (max-width:1240px) { + .book-body { + -webkit-transition: -webkit-transform 250ms ease; + -moz-transition: -moz-transform 250ms ease; + -o-transition: -o-transform 250ms ease; + transition: transform 250ms ease; + padding-bottom: 20px + } + .book-body .body-inner { + position: static; + min-height: calc(100% - 50px) + } +} +.page-wrapper { + position: relative; + outline: 0 +} +.page-inner { + position: relative; + margin: 0 auto +} +.page-inner .btn-group .btn { + border-radius: 0; + background: #eee; + border: 0 +} +.button { + border: 0; + background-color: transparent; + background: #eee; + color: #666; + width: 100%; + text-align: center; + float: left; + line-height: 1.42857143; + padding: 8px 4px +} +.button:hover { + color: #444 +} +.button:focus,.button:hover { + outline: 0 +} +.button.size-2 { + width: 50% +} +.button.size-3 { + width: 33% +} +#book-search-results .search-results .has-results .search-results-item,.markdown-section { + display: block; + word-wrap: break-word; + overflow: hidden; + line-height: 1.7; + text-size-adjust: 100%; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; + -moz-text-size-adjust: 100% +} +#book-search-results .search-results .has-results .search-results-item *,.markdown-section * { + box-sizing: border-box; + -webkit-box-sizing: border-box; + font-size: inherit +} +#book-search-results .search-results .has-results .search-results-item>:first-child,.markdown-section>:first-child { + margin-top: 0!important +} +#book-search-results .search-results .has-results .search-results-item>:last-child,.markdown-section>:last-child { + margin-bottom: 0!important +} +#book-search-results .search-results .has-results .search-results-item blockquote,#book-search-results .search-results .has-results .search-results-item code,#book-search-results .search-results .has-results .search-results-item figure,#book-search-results .search-results .has-results .search-results-item img,#book-search-results .search-results .has-results .search-results-item pre,#book-search-results .search-results .has-results .search-results-item table,#book-search-results .search-results .has-results .search-results-item tr,.markdown-section blockquote,.markdown-section code,.markdown-section figure,.markdown-section img,.markdown-section pre,.markdown-section table,.markdown-section tr { + page-break-inside: avoid +} +#book-search-results .search-results .has-results .search-results-item h2,#book-search-results .search-results .has-results .search-results-item h3,#book-search-results .search-results .has-results .search-results-item h4,#book-search-results .search-results .has-results .search-results-item h5,#book-search-results .search-results .has-results .search-results-item p,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section h5,.markdown-section p { + orphans: 3; + widows: 3 +} +#book-search-results .search-results .has-results .search-results-item h1,#book-search-results .search-results .has-results .search-results-item h2,#book-search-results .search-results .has-results .search-results-item h3,#book-search-results .search-results .has-results .search-results-item h4,#book-search-results .search-results .has-results .search-results-item h5,.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section h5 { + page-break-after: avoid +} +.markdown-section b,.markdown-section strong { + font-weight: 700 +} +#book-search-results .search-results .has-results .search-results-item em,.markdown-section em { + font-style: italic +} +#book-search-results .search-results .has-results .search-results-item dl,#book-search-results .search-results .has-results .search-results-item p,#book-search-results .search-results .has-results .search-results-item table,.markdown-section dl,.markdown-section p,.markdown-section table { + margin-top: 0; + margin-bottom: .85em +} +#book-search-results .search-results .has-results .search-results-item a,.markdown-section a { + text-decoration: none; + background: 0 0 +} +#book-search-results .search-results .has-results .search-results-item a:active,#book-search-results .search-results .has-results .search-results-item a:focus,#book-search-results .search-results .has-results .search-results-item a:hover,.markdown-section a:active,.markdown-section a:focus,.markdown-section a:hover { + outline: 0; + text-decoration: underline +} +#book-search-results .search-results .has-results .search-results-item img { + border: 0; + max-width: 100% +} +.markdown-section img { + border: 0 +} +#book-search-results .search-results .has-results .search-results-item hr,.markdown-section hr { + height: 4px; + padding: 0; + margin: 1.7em 0; + overflow: hidden; + background-color: #e7e7e7; + border: 0 +} +.markdown-section hr { + background-color: #d8d8d8 +} +#book-search-results .search-results .has-results .search-results-item hr:after,#book-search-results .search-results .has-results .search-results-item hr:before,.markdown-section hr:after,.markdown-section hr:before { + display: table; + content: " " +} +#book-search-results .search-results .has-results .search-results-item hr:after,.markdown-section hr:after { + clear: both +} +#book-search-results .search-results .has-results .search-results-item h1,#book-search-results .search-results .has-results .search-results-item h2,#book-search-results .search-results .has-results .search-results-item h4,#book-search-results .search-results .has-results .search-results-item h5,#book-search-results .search-results .has-results .search-results-item h6,.markdown-section h1,.markdown-section h2,.markdown-section h3,.markdown-section h4,.markdown-section h5,.markdown-section h6 { + margin-top: 1.275em; + margin-bottom: .85em; + font-weight: 700 +} +#book-search-results .search-results .has-results .search-results-item h3 { + font-weight: 700; + font-size: 1.5em +} +#book-search-results .search-results .has-results .search-results-item h1 { + font-size: 2em +} +#book-search-results .search-results .has-results .search-results-item h2 { + font-size: 1.75em +} +.markdown-section h3 { + font-size: 1.5em +} +#book-search-results .search-results .has-results .search-results-item h4,.markdown-section h4 { + font-size: 1.25em +} +#book-search-results .search-results .has-results .search-results-item h5,.markdown-section h5 { + font-size: 1em +} +#book-search-results .search-results .has-results .search-results-item h6,.markdown-section h6 { + font-size: 1em; + color: #777 +} +#book-search-results .search-results .has-results .search-results-item code,#book-search-results .search-results .has-results .search-results-item pre { + font-family: Consolas,"Liberation Mono",Menlo,Courier,monospace; + direction: ltr; + border: 0; + color: inherit +} +.markdown-section code,.markdown-section pre { + direction: ltr; + border: 0; + color: inherit +} +#book-search-results .search-results .has-results .search-results-item pre,.markdown-section pre { + overflow: auto; + word-wrap: normal; + padding: .85em 1em; + margin: 0 0 1.275em; + background: #f7f7f7 +} +#book-search-results .search-results .has-results .search-results-item pre>code,.markdown-section pre>code { + display: inline; + max-width: initial; + padding: 0; + margin: 0; + overflow: initial; + line-height: inherit; + font-size: .85em; + white-space: pre; + background: 0 0 +} +#book-search-results .search-results .has-results .search-results-item pre>code:after,#book-search-results .search-results .has-results .search-results-item pre>code:before,.markdown-section pre>code:after,.markdown-section pre>code:before { + content: normal +} +#book-search-results .search-results .has-results .search-results-item code { + padding: .2em; + margin: 0; + font-size: .85em; + background-color: #f7f7f7 +} +.markdown-section .katex,.markdown-section .katex-display,.markdown-section code { + padding: .2em; + margin: 0; + background-color: #f7f7f7 +} +#book-search-results .search-results .has-results .search-results-item code:after,#book-search-results .search-results .has-results .search-results-item code:before,.markdown-section code:after,.markdown-section code:before { + letter-spacing: -.2em; + content: "\00a0" +} +#book-search-results .search-results .has-results .search-results-item table,.markdown-section table { + display: table; + width: 100%; + border-collapse: collapse; + border-spacing: 0; + overflow: auto +} +#book-search-results .search-results .has-results .search-results-item table td,#book-search-results .search-results .has-results .search-results-item table th,.markdown-section table td,.markdown-section table th { + padding: 6px 13px; + border: 1px solid #ddd +} +#book-search-results .search-results .has-results .search-results-item table tr,.markdown-section table tr { + background-color: #fff; + border-top: 1px solid #ccc +} +#book-search-results .search-results .has-results .search-results-item table tr:nth-child(2n),.markdown-section table tr:nth-child(2n) { + background-color: #f8f8f8 +} +#book-search-results .search-results .has-results .search-results-item b,#book-search-results .search-results .has-results .search-results-item strong,#book-search-results .search-results .has-results .search-results-item table th,.markdown-section table th,pre.term.t-black .t-prompt { + font-weight: 700 +} +#book-search-results .search-results .has-results .search-results-item ol,#book-search-results .search-results .has-results .search-results-item ul,.markdown-section ol,.markdown-section ul { + margin: 0 0 .85em; + padding: 0 0 0 2em +} +#book-search-results .search-results .has-results .search-results-item h3,#book-search-results .search-results .has-results .search-results-item ol ol,#book-search-results .search-results .has-results .search-results-item ol ul,#book-search-results .search-results .has-results .search-results-item ul ol,#book-search-results .search-results .has-results .search-results-item ul ul,.markdown-section ol ol,.markdown-section ol ul,.markdown-section ul ol,.markdown-section ul ul { + margin-top: 0; + margin-bottom: 0 +} +#book-search-results .search-results .has-results .search-results-item ol ol,.markdown-section ol ol { + list-style-type: lower-roman +} +#book-search-results .search-results .has-results .search-results-item blockquote,.markdown-section blockquote { + margin: 0 0 .85em; + padding: 0 15px; + color: #858585; + border-left: 4px solid #e5e5e5 +} +.markdown-section blockquote { + border-left: 4px solid #d8d8d8; + color: rgba(0,0,0,.66) +} +#book-search-results .search-results .has-results .search-results-item blockquote:first-child,.markdown-section blockquote:first-child { + margin-top: 0 +} +#book-search-results .search-results .has-results .search-results-item blockquote:last-child,.markdown-section blockquote:last-child { + margin-bottom: 0 +} +#book-search-results .search-results .has-results .search-results-item dl,.markdown-section dl { + padding: 0 +} +#book-search-results .search-results .has-results .search-results-item dl dt,.markdown-section dl dt { + padding: 0; + margin-top: .85em; + font-style: italic; + font-weight: 700 +} +#book-search-results .search-results .has-results .search-results-item dl dd,.markdown-section dl dd { + padding: 0 .85em; + margin-bottom: .85em +} +#book-search-results .search-results .has-results .search-results-item dd,.markdown-section dd { + margin-left: 0 +} +.markdown-section .glossary-term { + cursor: help } - -/* navigation colors */ .navigation { - color: #d8d8d8; + position: absolute; + top: 50px; + bottom: 0; + margin: 0; + max-width: 150px; + min-width: 90px; + display: flex; + justify-content: center; + align-content: center; + flex-direction: column; + font-size: 40px; + text-align: center; + -webkit-transition: all 350ms ease; + -moz-transition: all 350ms ease; + -o-transition: all 350ms ease +} +.book-summary ul.summary li a:hover,.navigation:hover,a { + text-decoration: none +} +.navigation.navigation-next { + right: 0 +} +.navigation.navigation-prev { + left: 0 +} +@media (max-width:1240px) { + .navigation { + position: static; + top: auto; + max-width: 50%; + width: 50%; + display: inline-block; + float: left + } + .navigation.navigation-unique { + max-width: 100%; + width: 100% + } } -.navigation:hover { - color: #0c0c0c; +#book-search-input { + padding: 6px; + background: 0 0; + transition: top .5s ease; + background: #fff; + border-bottom: 1px solid rgba(0,0,0,.07); + border-top: 1px solid rgba(0,0,0,.07); + margin-top: -1px +} +#book-search-input input,#book-search-input input:focus,#book-search-input input:hover { + width: 100%; + background: 0 0; + border: 1px solid transparent; + box-shadow: none; + outline: 0; + line-height: 22px; + padding: 7px; + color: inherit +} +#book-search-results,pre.term:hover>button.t-copy,pre.term:hover>i.t-copy { + opacity: 1 +} +#book-search-results .search-results .search-results-title { + text-transform: uppercase; + text-align: center; + font-weight: 200; + margin-bottom: 35px; + opacity: .6 +} +#book-search-results .search-results .no-results { + padding: 40px 0; + display: none +} +body.search-loading #book-search-results { + opacity: .3 +} +* { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + -webkit-overflow-scrolling: touch; + -webkit-tap-highlight-color: transparent; + -webkit-text-size-adjust: none; + -webkit-touch-callout: none; + -webkit-font-smoothing: antialiased +} +body,html { + height: 100% +} +html { + font-size: 62.5% +} +body { + text-rendering: optimizeLegibility; + font-smoothing: antialiased; + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; + font-size: 14px; + letter-spacing: .2px; + text-size-adjust: 100%; + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100% } - -/* header colors */ -.book-header .btn { - color: #d8d8d8; +a.plugin-anchor { + color: inherit!important; + display: none; + margin-left: -30px; + padding-left: 40px; + cursor: pointer; + position: absolute; + left: 0; + bottom: 0; + top: -3px +} +a.plugin-anchor i { + margin-left: -30px; + font-size: 15px!important +} +.book .book-body .page-wrapper .page-inner section.normal { + overflow: visible +} +#code-textarea,#t-textarea { + height: 0; + position: fixed; + top: -1000px; + width: 0 +} +.code-wrapper,img,img:hover { + position: relative +} +.code-wrapper i { + cursor: pointer; + font-weight: 700; + position: absolute; + right: 1em; + top: 1em; + color: inherit; + font-size: .9em; + opacity: .5; + transition: all 150ms ease +} +.code-wrapper pre { + border-radius: 3px; + counter-reset: line; + font-size: 15px +} +.code-wrapper pre>code>span.code-line:before { + counter-increment: line; + color: #c1c7cd; + content: counter(line); + display: inline-block; + font-size: 12px; + margin-right: 1.5em; + width: 1em +} +figure { + margin: 1.5em 0; + padding: 10px 0 +} +figcaption { + clear: left; + text-align: center; + font-style: italic; + line-height: 1.5em; + margin: 1px 0 .75em +} +.left { + text-align: left +} +.right { + text-align: right +} +pre.term { + font-family: Consolas,"Liberation Mono",Menlo,Courier,monospace; + overflow-x: hidden; + padding: .85em 1em; + font-size: .85em; + position: relative +} +pre code.lang-term pre.term { + margin: 0; + padding: 0; + font-size: 1em +} +pre.term code { + display: block; + margin: 1em 2em 0 1em; + padding-bottom: 1em; + overflow-x: auto +} +pre.term.t-fade span.t-delimiter,pre.term.t-fade span.t-line:not(.t-prompt-line),pre.term.t-fade span.t-path,pre.term.t-fade span.t-pathsep,pre.term.t-fade span.t-prompt { + transition: opacity .3s ease-in-out +} +pre.term.t-fade:hover span.t-delimiter,pre.term.t-fade:hover span.t-line:not(.t-prompt-line),pre.term.t-fade:hover span.t-path,pre.term.t-fade:hover span.t-pathsep,pre.term.t-fade:hover span.t-prompt { + opacity: .3 +} +pre.term>button.t-copy,pre.term>i.t-copy { + cursor: pointer; + opacity: 0; + overflow: hidden; + position: absolute; + right: .4em; + transition: opacity .3s ease-in-out; + margin-top: 0 +} +pre.term.t-black { + background-color: #222; + color: #dedede +} +pre.term.t-classic { + background-color: #000; + color: #7cfc00 +} +pre.term.t-classic .t-error { + color: red +} +pre.term.t-classic .t-warning { + color: orange +} +pre.term.t-flat { + background-color: #2b3d50; + color: #dedede +} +pre.term.t-flat .t-delimiter { + color: #60b0e5 +} +pre.term.t-flat .t-error { + color: #f55 +} +pre.term.t-flat .t-prompt { + color: #28c66e +} +pre.term.t-flat .t-warning { + color: #d93 +} +pre.term.t-ubuntu { + background-color: #300b24; + color: #b8c4c5 +} +pre.term.t-ubuntu .t-error { + color: #e22227 +} +pre.term.t-ubuntu .t-path { + color: #475ca0 +} +pre.term.t-ubuntu .t-prompt { + color: #84cc40 +} +pre.term.t-ubuntu .t-warning { + color: #d93 +} +pre.term.t-white { + background-color: #fff; + color: #333 +} +pre.term.t-white .t-error { + color: #e22227 +} +pre.term.t-white .t-path { + color: #475ca0 +} +pre.term.t-white .t-prompt { + color: #4caf50 +} +pre.term.t-white .t-warning { + color: #d93 +} +pre.term.t-default { + background-color: #f7f7f7; + color: #333 +} +pre.term.t-default .t-error { + color: #e22227 +} +pre.term.t-default .t-path { + color: #475ca0 +} +pre.term.t-default .t-prompt { + color: #4caf50 +} +pre.term.t-default .t-warning { + color: #d93 +} +pre.term.t-default .t-delimiter { + color: #4090b5 +} +.book .book-body .page-wrapper .page-inner section.normal code .hljs-comment,.book .book-body .page-wrapper .page-inner section.normal code .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-comment,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-title { + color: #8e908c +} +.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-class,.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-id,.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo,.book .book-body .page-wrapper .page-inner section.normal code .hljs-attribute,.book .book-body .page-wrapper .page-inner section.normal code .hljs-deletion,.book .book-body .page-wrapper .page-inner section.normal code .hljs-regexp,.book .book-body .page-wrapper .page-inner section.normal code .hljs-tag,.book .book-body .page-wrapper .page-inner section.normal code .hljs-variable,.book .book-body .page-wrapper .page-inner section.normal code .html .hljs-doctype,.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-constant,.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-doctype,.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-pi,.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-tag .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-class,.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-id,.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-deletion,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-tag,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-variable,.book .book-body .page-wrapper .page-inner section.normal pre .html .hljs-doctype,.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-constant,.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-doctype,.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-pi,.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-tag .hljs-title { + color: #c82829 +} +.book .book-body .page-wrapper .page-inner section.normal code .hljs-built_in,.book .book-body .page-wrapper .page-inner section.normal code .hljs-constant,.book .book-body .page-wrapper .page-inner section.normal code .hljs-literal,.book .book-body .page-wrapper .page-inner section.normal code .hljs-number,.book .book-body .page-wrapper .page-inner section.normal code .hljs-params,.book .book-body .page-wrapper .page-inner section.normal code .hljs-pragma,.book .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-constant,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-literal,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-number,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-params,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor { + color: #f5871f +} +.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-rules .hljs-attribute,.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-class .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-rules .hljs-attribute,.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-class .hljs-title { + color: #eab700 +} +.book .book-body .page-wrapper .page-inner section.normal code .hljs-addition,.book .book-body .page-wrapper .page-inner section.normal code .hljs-header,.book .book-body .page-wrapper .page-inner section.normal code .hljs-inheritance,.book .book-body .page-wrapper .page-inner section.normal code .hljs-string,.book .book-body .page-wrapper .page-inner section.normal code .hljs-value,.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-symbol,.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-addition,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-header,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-inheritance,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-string,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-value,.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-symbol,.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata { + color: #718c00 +} +.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-hexcolor,.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-hexcolor { + color: #3e999f +} +.book .book-body .page-wrapper .page-inner section.normal code .coffeescript .hljs-title,.book .book-body .page-wrapper .page-inner section.normal code .hljs-function,.book .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-title,.book .book-body .page-wrapper .page-inner section.normal code .perl .hljs-sub,.book .book-body .page-wrapper .page-inner section.normal code .python .hljs-decorator,.book .book-body .page-wrapper .page-inner section.normal code .python .hljs-title,.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-function .hljs-title,.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-title .hljs-keyword,.book .book-body .page-wrapper .page-inner section.normal pre .coffeescript .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-function,.book .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre .perl .hljs-sub,.book .book-body .page-wrapper .page-inner section.normal pre .python .hljs-decorator,.book .book-body .page-wrapper .page-inner section.normal pre .python .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-function .hljs-title,.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-title .hljs-keyword { + color: #4271ae +} +.book .book-body .page-wrapper .page-inner section.normal code .hljs-keyword,.book .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-function,.book .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword,.book .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-function { + color: #8959a8 +} +.book .book-body .page-wrapper .page-inner section.normal code .hljs,.book .book-body .page-wrapper .page-inner section.normal pre .hljs { + display: block; + background: #fff; + color: #4d4d4c; + padding: .5em +} +.book .book-body .page-wrapper .page-inner section.normal code .coffeescript .javascript,.book .book-body .page-wrapper .page-inner section.normal code .javascript .xml,.book .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula,.book .book-body .page-wrapper .page-inner section.normal code .xml .css,.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata,.book .book-body .page-wrapper .page-inner section.normal code .xml .javascript,.book .book-body .page-wrapper .page-inner section.normal code .xml .vbscript,.book .book-body .page-wrapper .page-inner section.normal pre .coffeescript .javascript,.book .book-body .page-wrapper .page-inner section.normal pre .javascript .xml,.book .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,.book .book-body .page-wrapper .page-inner section.normal pre .xml .css,.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata,.book .book-body .page-wrapper .page-inner section.normal pre .xml .javascript,.book .book-body .page-wrapper .page-inner section.normal pre .xml .vbscript { + opacity: .5 +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs { + display: block; + padding: .5em; + background: #fdf6e3; + color: #657b83 +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-header,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-doctype,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-javadoc,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pi,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-template_comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-header,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-doctype,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-javadoc,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pi,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-template_comment,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-string { + color: #93a1a1 +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-tag,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-addition,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-request,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-status,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-winutils,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .method,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .nginx .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-tag,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-addition,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-request,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-status,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-winutils,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .method,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .nginx .hljs-title { + color: #859900 +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-command,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-hexcolor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_url,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-number,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-phpdoc,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-rules .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-tag .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-command,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-hexcolor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_url,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-number,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-phpdoc,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-rules .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag .hljs-value,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula { + color: #2aa198 +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-function,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-chunk,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-decorator,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-id,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-identifier,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-localvars,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .vhdl .hljs-literal,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-function,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-chunk,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-decorator,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-id,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-identifier,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-localvars,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .vhdl .hljs-literal { + color: #268bd2 +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .haskell .hljs-type,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-class .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-constant,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_reference,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-parent,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-variable,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-body,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .smalltalk .hljs-number,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .haskell .hljs-type,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-class .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_reference,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-parent,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-body,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .smalltalk .hljs-number { + color: #b58900 +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .clojure .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-change,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attr_selector,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-cdata,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-header,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-shebang,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-special,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-subst,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol .hljs-string,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .clojure .hljs-title,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-change,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attr_selector,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-cdata,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-header,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor .hljs-keyword,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-shebang,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-special,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-subst,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol .hljs-string { + color: #cb4b16 +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-deletion,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-important,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-deletion,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-important { + color: #dc322f +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_label,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_label { + color: #6c71c4 +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula { + background: #eee8d5 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-comment,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-title { + color: #969896 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-class,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-id,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-deletion,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-tag,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-variable,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .html .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-constant,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-pi,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-tag .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-class,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-id,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-deletion,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .html .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-constant,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-doctype,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-pi,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-tag .hljs-title { + color: #d54e53 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-constant,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-literal,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-number,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-params,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-literal,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-number,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-params,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor { + color: #e78c45 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-rules .hljs-attribute,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-class .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-rules .hljs-attribute,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-class .hljs-title { + color: #e7c547 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-addition,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-header,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-inheritance,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-string,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-value,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-symbol,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-addition,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-header,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-inheritance,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-string,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-value,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-symbol,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata { + color: #b9ca4a +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-hexcolor,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-hexcolor { + color: #70c0b1 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-function,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .perl .hljs-sub,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-decorator,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-function .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-title .hljs-keyword,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-function,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .perl .hljs-sub,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-decorator,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-function .hljs-title,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-title .hljs-keyword { + color: #7aa6da +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-function,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-function { + color: #c397d8 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs { + display: block; + background: #000; + color: #eaeaea; + padding: .5em +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .xml,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .css,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .vbscript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .xml,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .css,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .javascript,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .vbscript { + opacity: .5 +} +#book-search-results .search-results ul.search-results-list { + list-style-type: none; + padding-left: 0 +} +#book-search-results .search-results ul.search-results-list li { + margin-bottom: 1.5rem; + padding-bottom: .5rem +} +#book-search-results .search-results ul.search-results-list li p em { + background-color: rgba(255,220,0,.4); + font-style: normal +} +#book-search-results.open .search-results { + display: block +} +#book-search-results.no-results .search-results .has-results,#book-search-results.open .search-noresults { + display: none +} +#book-search-results.no-results .search-results .no-results { + display: block +} +.color-theme-1 .dropdown-menu { + background-color: #111; + border-color: #7e888b +} +.color-theme-1 .dropdown-menu .dropdown-caret .caret-inner { + border-bottom: 9px solid #111 +} +.color-theme-1 .dropdown-menu .buttons { + border-color: #7e888b +} +.color-theme-1 .dropdown-menu .button { + color: #afa790 +} +.color-theme-1 .dropdown-menu .button:hover { + color: #73553c +} +.color-theme-2 .dropdown-menu { + background-color: #2d3143; + border-color: #272a3a +} +.color-theme-2 .dropdown-menu .buttons { + border-color: #272a3a +} +.color-theme-2 .dropdown-menu .button { + color: #62677f +} +.color-theme-2 .dropdown-menu .button:hover { + color: #f4f4f5 +} +.book .book-header .font-settings .font-enlarge { + line-height: 30px; + font-size: 1.4em +} +.book .book-header .font-settings .font-reduce { + line-height: 30px; + font-size: 1em +} +.book.color-theme-1 .book-body,.book.color-theme-1 .book-body .page-wrapper .page-inner section { + background: #f3eacb +} +.book.color-theme-2 .book-body,.book.color-theme-2 .book-body .page-wrapper .page-inner section { + background: #1c1f2b +} +.book.font-size-0 .book-body .page-inner section { + font-size: 1.2rem +} +.book.font-size-1 .book-body .page-inner section { + font-size: 1.4rem +} +.book.font-size-2 .book-body .page-inner section { + font-size: 1.6rem +} +.book.font-size-3 .book-body .page-inner section { + font-size: 2.2rem +} +.book.font-size-4 .book-body .page-inner section { + font-size: 4rem +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h3,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h4,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h5,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { + color: inherit +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal blockquote,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2 { + border-color: inherit +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .highlight { + background-color: inherit +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .katex,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .katex-display,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre { + background: #fdf6e3; + color: #657b83; + border-color: #f8df9c +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table td,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table th { + border-color: #f5d06c +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr { + color: inherit; + background-color: #fdf6e3; + border-color: #444 +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { + background-color: #fbeecb +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal a { + color: #3eb1d0 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal blockquote,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2 { + border-color: #373b4e +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal hr { + background-color: #373b4e +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .katex,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .katex-display { + color: #9dbed8; + background: #2d3143; + border-color: #2d3143 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal .highlight { + background-color: #282a39 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table td,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table th { + border-color: #3b3f54 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr { + color: #b6c2d2; + background-color: #2d3143; + border-color: #3b3f54 +} +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { + background-color: #35394b +} +.book.color-theme-1 .book-header { + color: #afa790; + background: 0 0 +} +.book.color-theme-1 .book-header .btn:hover,.book.color-theme-2 .book-header .btn:hover { + background: 0 0 +} +.book.color-theme-2 .book-header { + color: #7e888b; + background: 0 0 +} +.book.color-theme-1 .book-body .navigation,.book.color-theme-1 .book-header .btn { + color: #afa790 +} +.book.color-theme-1 .book-body .navigation:hover { + color: #73553c +} +.book.color-theme-2 .book-body .navigation { + color: #383f52 +} +.book.color-theme-2 .book-body .navigation:hover { + color: #fffff5 +} +.book.color-theme-1 .book-summary { + background: #111; + border-right: 1px solid rgba(0,0,0,.07) +} +.book.color-theme-1 .book-summary .book-search,.book.color-theme-2 .book-summary .book-search { + background: 0 0 +} +.book.color-theme-1 .book-summary .book-search input,.book.color-theme-1 .book-summary .book-search input:focus,.book.color-theme-2 .book-summary .book-search input,.book.color-theme-2 .book-summary .book-search input:focus { + border: 1px solid transparent +} +.book.color-theme-1 .book-summary ul.summary li.divider { + background: #7e888b; + box-shadow: none +} +.book.color-theme-1 .book-summary ul.summary li i.fa-check,.book.color-theme-2 .book-summary ul.summary li i.fa-check { + color: #3c3 +} +.book.color-theme-1 .book-summary ul.summary li.done>a { + color: #877f6a +} +.book.color-theme-1 .book-summary ul.summary li a,.book.color-theme-1 .book-summary ul.summary li a:hover,.book.color-theme-1 .book-summary ul.summary li span,.book.color-theme-1 .book-summary ul.summary li.active>a { + background: 0 0; + font-weight: 400 +} +.book.color-theme-2 .book-summary ul.summary li.divider { + background: #272a3a; + box-shadow: none +} +.book.color-theme-2 .book-summary ul.summary li.done>a { + color: #62687f +} +.book.color-theme-2 .book-summary ul.summary li a { + background: 0 0 +} +.book.color-theme-2 .book-summary ul.summary li span { + background: 0 0; + font-weight: 600 +} +.book.color-theme-2 .book-summary ul.summary li a:hover,.book.color-theme-2 .book-summary ul.summary li.active>a { + background: #252737 +} +.markdown-section sub,.markdown-section sup { + font-size: 75% +} +.book.color-theme-1 #book-search-results .search-results .has-results .search-results-item a,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a,.book.color-theme-1 .markdown-section a { + color: #d11a4e +} +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr { + background-color: #957c76 +} +.book.color-theme-2 .book-summary ul.summary li a,.book.color-theme-2 .book-summary ul.summary li a:hover,.book.color-theme-2 .book-summary ul.summary li.active>a { + font-weight: 400 } -.book-header .btn:hover, .book-header h1 { - color: #0c0c0c; + transition: opacity .15s ease +} +.book-header .btn,.book-header .btn:hover,.navigation { + transition: all 150ms ease +} +.dropdown-menu .buttons .button:focus,.dropdown-menu .buttons .button:hover { + transition: all 150ms ease +} +.book-summary ul.summary li a:hover,.book-summary ul.summary li.active>a { + box-shadow: 0 2px 5px 1px rgba(0,0,0,.2) +} +kbd { + background-color: #fafbfc; + border-radius: 3px; + border: #d1d5da solid 1px; + box-shadow: #c6cbd1 0 -1px 0 0 inset; + color: #454a50; + display: inline-block; + font-size: .9em; + font-family: SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace; + font-weight: 400; + padding: .07em .3em; + line-height: 1em; + vertical-align: middle +} +.dropdown-menu .buttons .button { + transition: color 150ms ease +} +.fa.fa-clone.t-copy:hover { + opacity: 1 +} +.book-body,.markdown-section,.normal.markdown-section { + background-color: #fff; + color: #0c0c0c +} +.book-summary { + background-color: #f2f2f2 +} +#book-search-results .search-results .has-results .search-results-item,.book-header .btn:hover,.book-header h1,.book-summary ul.summary li a,.book-summary ul.summary li span,.book-summary ul.summary li.active>a,.dropdown-menu .buttons .button:hover,.navigation:hover { + color: #0c0c0c +} +.book-summary ul.summary li.header { + color: #8f8f8f; + padding-top: 32px; + padding-bottom: 7px +} +li.header:nth-child(1) { + padding-top: 15px!important +} +.book-header .btn,.navigation { + color: #d8d8d8 } - #book-search-input { - background-color: #ffffff; - margin-bottom: 0px; /* base attr */ - color: #0c0c0c; + background-color: #fff; + margin-bottom: 0; + color: #0c0c0c } - -/* dropdown menu */ .dropdown-menu { background-color: #f2f2f2; - border: 0px; /* base attr */ - border-radius: 2px; /* base attr */ - box-shadow: 0px 3px 5px 0px rgba(0, 0, 0, 0.2); /* base attr */ + border: 0; + border-radius: 2px; + box-shadow: 0 3px 5px 0 rgba(0,0,0,.2) } .dropdown-menu .buttons .button { - color: #8f8f8f; -} -.dropdown-menu .buttons .button:hover { - color: #0c0c0c; + color: #8f8f8f } .dropdown-menu .dropdown-caret .caret-inner { - border-bottom: 9px solid #f2f2f2; + border-bottom: 9px solid #f2f2f2 } - -/* hr colors */ .markdown-section h1 { - font-size: 2em; /* base attr */ - border-bottom: 2px solid #d8d8d8; + font-size: 2em; + border-bottom: 2px solid #d8d8d8 } .markdown-section h2 { - font-size: 1.75em; /* base attr */ - border-bottom: 1px solid #d8d8d8; -} -.markdown-section hr { - height: 4px; /* base attr */ - background-color: #d8d8d8; + font-size: 1.75em; + border-bottom: 1px solid #d8d8d8 } - -/* code wrapper colors */ .code-wrapper pre { - background: #f7f8f9; -} - -/* link colors */ -.markdown-section a { - color: #2f77bf; -} - -/* search results page */ -#book-search-results .search-results .has-results .search-results-item a { - color: #2f77bf; -} -#book-search-results .search-results .has-results .search-results-item { - color: #0c0c0c; -} - -/* theme 1 */ -/* page background */ - -.book.color-theme-1 .book-body, -.book.color-theme-1 .book-body .page-wrapper .page-inner section, -.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal { + background: #f7f8f9 +} +#book-search-results .search-results .has-results .search-results-item a,.markdown-section a { + color: #2f77bf +} +.book.color-theme-1 .book-body,.book.color-theme-1 .book-body .page-wrapper .page-inner section,.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal { background-color: #f3eacb; - color: #663a0f; + color: #663a0f } - -/* sidebar background color + subchapter text color */ -.book.color-theme-1 .book-summary, -.book.color-theme-1 .book-summary ul.summary li a, -.book.color-theme-1 .book-summary ul.summary li span { +.book.color-theme-1 .book-summary,.book.color-theme-1 .book-summary ul.summary li a,.book.color-theme-1 .book-summary ul.summary li span { color: #42260a; - background: #be9470; + background: #be9470 } -.book.color-theme-1 .book-summary ul.summary li.active > a, -.book.color-theme-1 .book-summary ul.summary li a:hover { +.book.color-theme-1 .book-summary ul.summary li a:hover,.book.color-theme-1 .book-summary ul.summary li.active>a { background: #a68162; - box-shadow: 0px 2px 5px 1px rgba(0, 0, 0, 0.2); + box-shadow: 0 2px 5px 1px rgba(0,0,0,.2); color: #42260a; - z-index: 100; + z-index: 100 } - -/* sidebar divider bar color */ .book.color-theme-1 .book-summary ul.summary li.divider { - background-color: #a68162; -} - -/* sidebar header text color */ -.book.color-theme-1 .book-summary ul.summary li.header { - color: #f2f2da; -} - -/* navigation colors */ -.book.color-theme-1 .navigation { - color: rgba(149, 124, 118, 0.5); -} -.book.color-theme-1 .navigation:hover { - color: #663a0f; + background-color: #a68162 } - -/* header colors */ -.book.color-theme-1 .book-header .btn { - color: rgba(149, 124, 118, 0.5); +.book.color-theme-1 #book-search-results .search-results .has-results .search-results-item,.book.color-theme-1 .book-header .btn:hover,.book.color-theme-1 .book-header h1,.book.color-theme-1 .dropdown-menu .buttons .button:hover,.book.color-theme-1 .navigation:hover { + color: #663a0f } -.book.color-theme-1 .book-header .btn:hover, -.book.color-theme-1 .book-header h1 { - color: #663a0f; +.book.color-theme-1 .book-header .btn,.book.color-theme-1 .navigation { + color: rgba(149,124,118,.5) } - .book.color-theme-1 #book-search-input { background-color: #f2f2da; - color: #663a0f; + color: #663a0f } - -/* dropdown menu colors */ .book.color-theme-1 .dropdown-menu { - background-color: #be9470; + background-color: #be9470 } .book.color-theme-1 .dropdown-menu .buttons { - border-color: #a68162; + border-color: #a68162 } -.book.color-theme-1 .dropdown-menu .buttons .button { - color: #f2f2da; -} -.book.color-theme-1 .dropdown-menu .buttons .button:hover { - color: #663a0f; +.book.color-theme-1 .book-summary ul.summary li.header,.book.color-theme-1 .dropdown-menu .buttons .button { + color: #f2f2da } .book.color-theme-1 .dropdown-menu .dropdown-caret .caret-inner { - border-bottom: 9px solid #be9470; -} - -/* hr colors */ -.book.color-theme-1 .markdown-section h1 { - border-bottom: 2px solid #957c76; -} -.book.color-theme-1 .markdown-section h2 { - border-bottom: 1px solid #957c76; -} -.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr { - background-color: #957c76; + border-bottom: 9px solid #be9470 } -.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1 { - border-bottom: 2px solid #957c76; +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1,.book.color-theme-1 .markdown-section h1 { + border-bottom: 2px solid #957c76 } -.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2 { - border-bottom: 1px solid #957c76; +.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2,.book.color-theme-1 .markdown-section h2 { + border-bottom: 1px solid #957c76 } -/* code wrapper colors */ .book.color-theme-1 .code-wrapper pre { - background: #957c76; -} - -/* link colors */ -.book.color-theme-1 .markdown-section a { - color: #d11a4e; -} - -/* search results page */ -.book.color-theme-1 - #book-search-results - .search-results - .has-results - .search-results-item - a { - color: #d11a4e; -} -.book.color-theme-1 - #book-search-results - .search-results - .has-results - .search-results-item { - color: #663a0f; -} - -/* theme 2 */ -/* page background */ -.book.color-theme-2 .book-body, -.book.color-theme-2 .book-body .page-wrapper .page-inner section, -.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal { + background: #957c76 +} +.book.color-theme-2 #book-search-input,.book.color-theme-2 .book-body,.book.color-theme-2 .book-body .page-wrapper .page-inner section,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal { background-color: #1c1f2b; - color: #dfebf5; + color: #dfebf5 } - -/* sidebar background color + subchapter text color */ .book.color-theme-2 .book-summary { color: #dfebf5; - background: #2d3143; + background: #2d3143 } -.book.color-theme-2 .book-summary ul.summary li a, -.book.color-theme-2 .book-summary ul.summary li span { - color: #dfebf5; +.book.color-theme-2 #book-search-results .search-results .has-results .search-results-item,.book.color-theme-2 .book-header .btn:hover,.book.color-theme-2 .book-header h1,.book.color-theme-2 .book-summary ul.summary li a,.book.color-theme-2 .book-summary ul.summary li span,.book.color-theme-2 .dropdown-menu .buttons .button:hover { + color: #dfebf5 } -.book.color-theme-2 .book-summary ul.summary li.active > a, -.book.color-theme-2 .book-summary ul.summary li a:hover { +.book.color-theme-2 .book-summary ul.summary li a:hover,.book.color-theme-2 .book-summary ul.summary li.active>a { color: #dfebf5; - background: #3e435c; + background: #3e435c } - -/* sidebar divider bar color */ .book.color-theme-2 .book-summary ul.summary li.divider { - background-color: #272a3a; + background-color: #272a3a } - -/* sidebar header text color */ .book.color-theme-2 .book-summary ul.summary li.header { - color: #b3bfff; + color: #b3bfff } - -/* navigation colors -- this style is really bad, this needs a manual !important to work */ .book.color-theme-2 .navigation { - color: #a0a9a6 !important; -} -.book.color-theme-2 .navigation:hover { - color: #dfebf5 !important; + color: #a0a9a6!important } - -/* header colors */ -.book.color-theme-2 .book-header .btn { - color: #595f7f; +.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h3,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h4,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h5,.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6,.book.color-theme-2 .navigation:hover { + color: #dfebf5!important } -.book.color-theme-2 .book-header .btn:hover, -.book.color-theme-2 .book-header h1, -.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1 { - color: #dfebf5; -} -/* this theme is so bad */ -.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, -.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2, -.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h3, -.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h4 { - color: #dfebf5 !important; -} -.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h5, -.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { - color: #dfebf5 !important; -} - -.book.color-theme-2 #book-search-input { - background-color: #1c1f2b; - color: #dfebf5; +.book.color-theme-2 .book-header .btn,.book.color-theme-2 .dropdown-menu .buttons .button { + color: #595f7f } - -/* dropdown menu colors */ .book.color-theme-2 .dropdown-menu { - background-color: #2d3143; -} -.book.color-theme-2 .dropdown-menu .buttons .button { - color: #595f7f; -} -.book.color-theme-2 .dropdown-menu .buttons .button:hover { - color: #dfebf5; + background-color: #2d3143 } .color-theme-2 .dropdown-menu .dropdown-caret .caret-inner { - border-bottom: 9px solid #2d3143; + border-bottom: 9px solid #2d3143 } - -/* hr colors */ .book.color-theme-2 .markdown-section h1 { - border-bottom: 2px solid #a0a9a6; + border-bottom: 2px solid #a0a9a6 } .book.color-theme-2 .markdown-section h2 { - border-bottom: 1px solid #a0a9a6; + border-bottom: 1px solid #a0a9a6 } .book.color-theme-2 .markdown-section hr { - background-color: #a0a9a6; + background-color: #a0a9a6 } - -/* code wrapper colors */ .book.color-theme-2 .code-wrapper pre { - background: #a0a9a6; -} - -/* link colors */ -.book.color-theme-2 .markdown-section a { - color: #3eb1d0; -} - -/* search results page */ -.book.color-theme-2 - #book-search-results - .search-results - .has-results - .search-results-item - a { - color: #3eb1d0; -} -.book.color-theme-2 - #book-search-results - .search-results - .has-results - .search-results-item { - color: #dfebf5; + background: #a0a9a6 +} +.book.color-theme-2 #book-search-results .search-results .has-results .search-results-item a,.book.color-theme-2 .markdown-section a { + color: #3eb1d0 } - -/* page sizing */ .page-inner { max-width: 90em; - padding: 1.5em 5em 3em 5em; + padding: 1.5em 5em 3em } -@media (max-width: 1240px) { +@media (max-width:1240px) { .page-inner { - /* don't need space for arrows */ - padding: 1.5em 1.5em 3em 1.5em; + padding: 1.5em 1.5em 3em } } - -/* fonts */ .book.font-family-0 { - font-family: "Noto Serif", serif !important; + font-family: "Noto Serif",serif!important } -.book.font-family-1, -.book-summary { - font-family: "Fira Sans", sans-serif !important; -} -/* fixing code not scaling with text-scaling */ -.markdown-section code, -.markdown-section pre { - font-family: "Fira Mono", monospace !important; -} -.markdown-section pre { - font-size: 1em; +.book-summary,.book.font-family-1 { + font-family: "Fira Sans",sans-serif!important } -.markdown-section code { - font-size: 1em; +.markdown-section code,.markdown-section pre { + font-family: "Fira Mono",monospace!important; + font-size: 1em } -/* size and transparency for line numbers */ -.code-wrapper pre > code > span.code-line::before { +.code-wrapper pre>code>span.code-line::before { color: inherit; - opacity: 0.75; - font-size: 1em; -} -/* sidebar shadowing */ - -.book-summary { - border-right: none; + opacity: .75; + font-size: 1em } .book.with-summary .book-summary { - box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.2); -} -.book.color-theme-1 .book-summary { - border-right: none; + box-shadow: 0 0 6px 0 rgba(0,0,0,.2) } -.book.color-theme-2 .book-summary { - border-right: none; +.book-summary,.book.color-theme-1 .book-summary,.book.color-theme-2 .book-summary { + border-right: none } - -/* header centering */ .book-header h1 { - padding-left: 79px; + padding-left: 79px } - -/* figure margins and padding */ .markdown-section figure { - padding-top: 0px; - padding-bottom: 0px; -} -figcaption { - margin-top: 1px; + padding-top: 0; + padding-bottom: 0 } - -/* image hovering shadow/zoom */ img:hover { - position: relative; z-index: 100; - /* will dim entire display except picture and sidebar */ - /* box-shadow: 0px 0px 10000px 10000px rgba(0, 0, 0, 0.4);*/ - box-shadow: 0px 0px 6px 0px rgba(0, 0, 0, 0.8); - max-width: 100% !important; + box-shadow: 0 0 6px 0 rgba(0,0,0,.8); + max-width: 100%!important; transition-delay: 300ms; transition-duration: 300ms; - transition-timing-function: ease-in; + transition-timing-function: ease-in } - -/* centering images with CSS instead of in-line HTML */ -/* also reverses hovering shadow/zoom transition */ img { - position: relative; display: block; margin-left: auto; margin-right: auto; transition-delay: 50ms; transition-duration: 150ms; - transition-timing-function: ease-out; + transition-timing-function: ease-out } - -/* scaling down images to a sensible size based on .page-inner */ .markdown-section img { - max-width: 70%; + max-width: 70% } -@media (max-width: 1240px) { +@media (max-width:1240px) { .markdown-section img { max-width: 100% } img:hover { - box-shadow: 0px 0px 0px 0px rgba(0, 0, 0, 0); + box-shadow: 0 0 0 0 transparent } } - -/* Glossary terms formatting */ .markdown-section .glossary-term { - text-decoration: none !important; - border-bottom: 0.1em dashed; + text-decoration: none!important; + border-bottom: .1em dashed } .markdown-section .glossary-term:hover { cursor: help; position: relative; - text-decoration: none !important; -} - -/* Footnote formatting */ -.markdown-section blockquote { - border-left: 4px solid #d8d8d8; - color: rgba(0, 0, 0, 0.66); + text-decoration: none!important } .book.color-theme-1 .markdown-section blockquote { - border-left: 4px solid #957c76 !important; - color: rgba(102, 58, 15, 0.66); + border-left: 4px solid #957c76!important; + color: rgba(102,58,15,.66) } .book.color-theme-2 .markdown-section blockquote { border-left: 4px solid #373b4e; - color: rgba(255, 255, 255, 0.66); + color: rgba(255,255,255,.66) } - -/* Gitbook link formatting */ .gitbook-link { margin-bottom: 40px; text-align: center; - transition: none !important; - box-shadow: 0px 0px 0px 0px !important; - font-size: 90%; + transition: none!important; + box-shadow: 0 0 0 0!important; + font-size: 90% +} +.katex::after,.katex::before { + content: "\00a0" +} +.katex-display { + box-sizing: border-box; + display: block; + padding-left: 1em; + padding-right: 1em; + padding-top: .85em!important; + padding-bottom: .85em!important; + margin-bottom: 1.275em; + border-radius: 3px +} +.katex { + font: inherit!important; + padding: .3em 0!important +} +.book.color-theme-1 .katex { + background: #fdf6e3; + color: #657b83; + border-color: #f8df9c +} +.book.color-theme-2 .katex { + color: #9dbed8; + background: #2d3143; + border-color: #2d3143 +} +.book.color-theme-1 .katex-display { + background: #fdf6e3 +} +.book.color-theme-2 .katex-display { + background: #2d3143 +} +.fa.fa-clone.t-copy:hover { + opacity: 1; +} +@media screen and (orientation: portrait) { + .btn.pull-right.js-toolbar-action { + /* prioritizes getting rid of the social media buttons + this fixes a weird issue on iPhone 6/7/8 where the 'A' is 5% visible and shifts the title to the right */ + display: none; + } } diff --git a/typesetting/aegisub.md b/typesetting/aegisub.md index 3f56ea2..51d4b40 100644 --- a/typesetting/aegisub.md +++ b/typesetting/aegisub.md @@ -51,7 +51,7 @@ Here is a list of tools you will want to download: [Mocha Pro standalone app]: https://www.imagineersystems.com/products/mocha-pro/ [Quicktime]: https://support.apple.com/kb/DL837?locale=en_US [quicktimeFAQ]: https://borisfx.com/faq/quicktime-on-windows/ -[x264 binary]: https://download.videolan.org/x264/binaries/ +[x264 binary]: https://artifacts.videolan.org/x264/ [Adobe Photoshop and Illustrator]: https://www.adobe.com/creativecloud.html [Gimp]: https://www.gimp.org [Inkscape]: https://inkscape.org/en/