aboutsummaryrefslogtreecommitdiff
path: root/docs/components/code.md
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2015-04-17 12:41:49 -0700
committerMark Otto <[email protected]>2015-04-17 12:41:49 -0700
commit0156f9a2379b68cd3cf284bc4e7799fda221203e (patch)
tree51a8147fc42d467f0c6e2b9fbe203b6f90de1573 /docs/components/code.md
parente70d9077f025cb1cb168e50b87f60423be9e6a00 (diff)
downloadbootstrap-0156f9a2379b68cd3cf284bc4e7799fda221203e.tar.xz
bootstrap-0156f9a2379b68cd3cf284bc4e7799fda221203e.zip
move remaining files to components subdir
Diffstat (limited to 'docs/components/code.md')
-rw-r--r--docs/components/code.md49
1 files changed, 49 insertions, 0 deletions
diff --git a/docs/components/code.md b/docs/components/code.md
new file mode 100644
index 000000000..19c02c84e
--- /dev/null
+++ b/docs/components/code.md
@@ -0,0 +1,49 @@
+---
+layout: page
+title: Code
+---
+
+Styles for inline code snippets and longer, multiline blocks of code.
+
+## Inline code
+
+Wrap inline snippets of code with `code`. Be sure to escape HTML angle brackets.
+
+{% example html %}
+For example, <code>&lt;section&gt;</code> should be wrapped as inline.
+{% endexample %}
+
+## User input
+
+Use the `<kbd>` to indicate input that is typically entered via keyboard.
+
+{% example html %}
+To switch directories, type <kbd>cd</kbd> followed by the name of the directory.<br>
+To edit settings, press <kbd><kbd>ctrl</kbd> + <kbd>,</kbd></kbd>
+{% endexample %}
+
+## Preformatted text
+
+Or, code blocks. Use `<pre>`s for multiple lines of code. Once again, be sure to escape any angle brackets in the code for proper rendering.
+
+{% example html %}
+<pre>&lt;p&gt;Sample text here...&lt;/p&gt;</pre>
+{% endexample %}
+
+You may optionally add the `.pre-scrollable` class, which will set a max-height of 350px and provide a y-axis scrollbar.
+
+## Variables
+
+For indicating variables use the `<var>` tag.
+
+{% example html %}
+<var>y</var> = <var>m</var><var>x</var> + <var>b</var>
+{% endexample %}
+
+## Sample output
+
+For indicating blocks sample output from a program use the `<samp>` tag.
+
+{% example html %}
+<samp>This text is meant to be treated as sample output from a computer program.</samp>
+{% endexample %}