### RST Indentation Example
Source: https://github.com/wave-harmonic/crest/blob/master/docs/README.md
Demonstrates correct indentation for lists in reStructuredText, using two spaces after the dash and aligning subsequent lines.
```rst
- Notice the two spaces after the dash.
This is a new line.
```
--------------------------------
### Workaround for Headings in Tabs
Source: https://github.com/wave-harmonic/crest/blob/master/docs/README.md
This example shows a workaround for headings within tabs using 'raw' HTML for HTML output and plain text for LaTeX, though these headings lack permalinks and ToC integration.
```rst
.. only:: html
.. raw:: html
Heading
.. only:: latex
Heading
''''''
```
--------------------------------
### Defining Custom Labels with 'set' Directive
Source: https://github.com/wave-harmonic/crest/blob/master/docs/README.md
Define custom labels using the 'set' directive, associating a tag with its display text. This example sets the '[URP]' label to display as 'URP'.
```rst
.. set:: [URP] :guilabel:`URP`
```
--------------------------------
### Get Custom Variable in Sphinx
Source: https://github.com/wave-harmonic/crest/blob/master/docs/README.md
Fetches a custom variable 'Key' using the default role syntax (`Key`) or the explicit ':get:' role syntax (:get:`Key`) in Sphinx.
```rst
Get something with Key using the default role syntax: `Key`
Get something with Key using the explicit role syntax: :get:`Key`
```
--------------------------------
### Conditional Content with 'only' Directive
Source: https://github.com/wave-harmonic/crest/blob/master/docs/README.md
Use the 'only' directive to show content based on specific tags. This example demonstrates content for 'birp' or 'urp' tags, and content for the 'hdrp' tag.
```rst
.. only:: birp or urp
BIRP and URP content.
.. only:: hdrp
HDRP content.
```
--------------------------------
### ShaderToy Header and Copyright Notice
Source: https://github.com/wave-harmonic/crest/blob/master/crest/Assets/Crest/Crest/Shaders/GPUNoise/SOURCE.txt
Includes the MIT license and copyright information required when translating ShaderToy shaders.
```text
//Quality hashes collection
//by nimitz 2018 (twitter: @stormoid)
//The MIT License
//Permission is hereby granted, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
```
--------------------------------
### Conditional Content in Lists with 'only'
Source: https://github.com/wave-harmonic/crest/blob/master/docs/README.md
The 'only' directive can break lists. This example shows how standard 'only' directives split a list, and how 'bullet_list' keeps it together.
```rst
- All pipelines
.. only:: hdrp
- HDRP only
.. only:: urp
- URP only
```
```rst
.. bullet_list::
- All pipelines
.. only:: hdrp
- HDRP only
.. only:: urp
- URP only
```
--------------------------------
### Render Transparent Object Before Transparent Pass
Source: https://github.com/wave-harmonic/crest/wiki/Transparency-Workarounds
This C# script uses a CommandBuffer to draw a specific renderer before the transparent pass. Attach this script to a GameObject and assign the renderer you want to draw early to the 'testRenderer' field. Ensure the material on 'testRenderer' is set up correctly for transparency.
```csharp
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
public class DamageRenderer : MonoBehaviour
{
CommandBuffer mCacheCommandBuffer;
public MeshRenderer testRenderer;
void OnEnable()
{
mCacheCommandBuffer = new CommandBuffer();
mCacheCommandBuffer.name = "DamageRenderCommandBuffer";
mCacheCommandBuffer.DrawRenderer(testRenderer, testRenderer.material, 0, -1);
Camera.main.AddCommandBuffer(CameraEvent.AfterSkybox, mCacheCommandBuffer);
}
void OnDisable()
{
Camera.main.RemoveCommandBuffer(CameraEvent.AfterSkybox, mCacheCommandBuffer);
mCacheCommandBuffer.Dispose();
}
}
```
--------------------------------
### Conditional Tab Inclusion in Sphinx
Source: https://github.com/wave-harmonic/crest/blob/master/docs/README.md
Conditionally includes content for the 'urp' render pipeline using the 'only' directive, followed by a tabbed section that includes URP-specific variables and pipeline setup.
```rst
.. only:: urp
.. tab:: `URP`
.. include:: /includes/_urp-vars.rst
.. include:: includes/_pipeline-setup.rst
```
--------------------------------
### Sphinx Substitution with Nested Braces
Source: https://github.com/wave-harmonic/crest/blob/master/docs/README.md
Demonstrates nested substitutions using braces. 'TAALong' is defined first, then used within the definition of 'TAA' to create a more descriptive abbreviation.
```rst
.. set:: TAALong :abbr:`Temporal Anti-Aliasing`
.. set:: TAA :abbr:`TAA ({TAALong})`
`TAA` is a form of anti-aliasing.
```
--------------------------------
### Sphinx Substitution with Abbreviation
Source: https://github.com/wave-harmonic/crest/blob/master/docs/README.md
Creates an abbreviation for 'TAA' using the 'set' directive, which expands to ':abbr:`TAA (Temporal Anti-Aliasing)`'. This allows for concise referencing.
```rst
.. set:: TAA :abbr:`TAA (Temporal Anti-Aliasing)`
`TAA` is a form of anti-aliasing.
```
--------------------------------
### Non-Stripped Labels with Custom Syntax
Source: https://github.com/wave-harmonic/crest/blob/master/docs/README.md
To create labels that are not stripped in PDFs, use double backticks. This ensures the labels remain visible in all output formats.
```rst
BIRP and URP Content `[[BIRP]]` `[[URP]]`
HDRP Content `[[HDRP]]`
```
--------------------------------
### Conditional Labels with Custom Syntax
Source: https://github.com/wave-harmonic/crest/blob/master/docs/README.md
Use custom syntax with backticks for labels that are stripped during PDF generation. Multiple tags in one set of backticks are treated as an 'OR' condition.
```rst
BIRP and URP Content `[BIRP] [URP]`
HDRP Content `[HDRP]`
```