20
This commit is contained in:
parent
15794d8ca3
commit
3ce5910bde
|
@ -1,10 +0,0 @@
|
|||
|
||||
<p style="color:white;background-color:black;">
|
||||
<code>
|
||||
{
|
||||
line 1 of code
|
||||
line 2 of code();
|
||||
line 3 of code
|
||||
}
|
||||
</code>
|
||||
</p>
|
|
@ -1 +0,0 @@
|
|||
Subproject commit 1ec15599c57101e0c3203140bf81b5a91fa1217b
|
102
test/testcss.md
102
test/testcss.md
|
@ -1,102 +0,0 @@
|
|||
|
||||
<pre style="max-height: 100px;">
|
||||
|
||||
### Header
|
||||
|
||||
<div align="center">...body...text...</div>
|
||||
|
||||
<div align="center">...body...text...</div>
|
||||
|
||||
<div align="center">...body...text...</div>
|
||||
|
||||
<div align="center">...body...text...</div>
|
||||
|
||||
<div align="center">...body...text...</div>
|
||||
|
||||
<div align="center">...body...text...</div>
|
||||
|
||||
<div align="center">...body...text...</div>
|
||||
|
||||
</pre>
|
||||
|
||||
<pre style="max-height: 100px;">
|
||||
<code>## [1] 1 2 3 4 5 6 7 8 9 10
|
||||
## [11] 11 12 13 14 15 16 17 18 19 20
|
||||
## ... ...</code>
|
||||
</pre>
|
||||
|
||||
|
||||
```{r, include=FALSE}
|
||||
options(width = 60)
|
||||
local({
|
||||
hook_output <- knitr::knit_hooks$get('output')
|
||||
knitr::knit_hooks$set(output = function(x, options) {
|
||||
if (!is.null(options$max.height)) options$attr.output <- c(
|
||||
options$attr.output,
|
||||
sprintf('style="max-height: %s;"', options$max.height)
|
||||
)
|
||||
hook_output(x, options)
|
||||
})
|
||||
})
|
||||
```
|
||||
|
||||
# Heading 1
|
||||
Regular text.
|
||||
**Bold text.** *Italic text.* ***Both: bold and italic.***
|
||||
|
||||
A line (horizontal ruler) using underscores:
|
||||
___
|
||||
|
||||
<s>Strike through</s> NB. using `~~deleted text~~` doesn't work in Freeplane (Java html/css renderer)
|
||||
|
||||
E.g. ~~deleted text~~
|
||||
|
||||
<u>Underlined text</u>
|
||||
|
||||
## Heading 2
|
||||
> A quote, line 1.
|
||||
> Line 2 of the quote (will be joined with line 1).
|
||||
>> A quote within a quote
|
||||
|
||||
### Heading 3
|
||||
Sample text with `an in-line piece of code`.
|
||||
|
||||
```groovy
|
||||
// a Groovy code example - as a block of code
|
||||
def name = 'Freeplane User'
|
||||
"Hello, ${name}!"
|
||||
"Hello2, ${name2}!"
|
||||
```
|
||||
|
||||
Another example of a block of code
|
||||
introduced as indented Markdown (with a tab or 4 spaces)
|
||||
|
||||
> An example of a quote
|
||||
> containing a block of code
|
||||
> At least 5 spaces need to be used
|
||||
> And it continues as a regular quote
|
||||
|
||||
#### Heading 4
|
||||
A table
|
||||
|
||||
| # | Language | [Pangram](https://en.wikipedia.org/wiki/Pangram) |
|
||||
|--|--|--|
|
||||
| 1 | English | The quick brown fox jumps over the lazy dog |
|
||||
| 2 | French | Portez ce vieux whisky au juge blond qui fume |
|
||||
| 3 | German | Victor jagt zwölf Boxkämpfer quer über den großen Sylter Deich |
|
||||
| 4 | Italian | Pranzo d'acqua fa volti sghembi |
|
||||
| 5 | Spanish | Benjamín pidió una bebida de kiwi y fresa. Noé, sin vergüenza, la más exquisita champaña del menú |
|
||||
|
||||
##### Heading 5
|
||||
A list of items
|
||||
|
||||
* Item 1
|
||||
* Item 2
|
||||
* Item 3
|
||||
|
||||
###### Heading 6
|
||||
A numbered list
|
||||
|
||||
1. Item A
|
||||
2. Item B
|
||||
3. Item C
|
|
@ -1,45 +0,0 @@
|
|||
---
|
||||
title: Scrollable code blocks
|
||||
input : markdown
|
||||
output: html_document
|
||||
---
|
||||
|
||||
```{css, echo=FALSE}
|
||||
pre {
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
pre[class] {
|
||||
max-height: 100px;
|
||||
}
|
||||
```
|
||||
|
||||
We have defined some CSS rules to limit the height of
|
||||
code blocks. Now we can test if these rules work on code
|
||||
blocks and text output:
|
||||
|
||||
```{r}
|
||||
# pretend that we have a lot of code in this chunk
|
||||
if (1 + 1 == 2) {
|
||||
# of course that is true
|
||||
print(mtcars)
|
||||
# we just printed a lengthy data set
|
||||
}
|
||||
```
|
||||
|
||||
Next we add rules for a new class `scroll-100` to limit
|
||||
the height to 100px, and add the class to the output of
|
||||
a code chunk via the chunk option `class.output`:
|
||||
|
||||
```{css, echo=FALSE}
|
||||
.scroll-100 {
|
||||
max-height: 100px;
|
||||
overflow-y: auto;
|
||||
background-color: inherit;
|
||||
}
|
||||
```
|
||||
|
||||
```{r, class.output="scroll-100"}
|
||||
print(mtcars)
|
||||
```
|
Loading…
Reference in New Issue
Block a user