Compare commits
2 Commits
be6ea7b34e
...
598e2c84b9
| Author | SHA1 | Date |
|---|---|---|
|
|
598e2c84b9 | |
|
|
860380d46a |
|
|
@ -3,10 +3,12 @@ title: My Public File
|
||||||
cuid: 26e4-a1
|
cuid: 26e4-a1
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<!--summary-start-->
|
||||||
|
|
||||||
This is a public file with some nice text.
|
This is a public file with some nice text.
|
||||||
|
|
||||||
It's easy to write in this file.
|
It's easy to write in this file.
|
||||||
<!--summary-above-->
|
<!--summary-end-->
|
||||||
I can write more things after the comment if I want.
|
I can write more things after the comment if I want.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
gitrepo: "https://git.surfacemarkup.net/hans/ad_pubfiles"
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
//looks for an html comment pattern, and, if found,
|
//looks for an html comment pattern, and, if found,
|
||||||
//adds the text before it to the doc under the key `summary`.
|
//adds the text before it to the doc under the key `summary`.
|
||||||
const reg = /^(?<summary>.+)?<!--summary-above-->/s
|
const reg = /.*<!--summary-start-->(?<summary>.+)?<!--summary-end-->/s
|
||||||
|
//use a custom element instead.
|
||||||
|
// const reg = /<doc-summary>(?<summary>.+)?<\/doc-summary>/s
|
||||||
export default (doc) => {
|
export default (doc) => {
|
||||||
const result = reg.exec(doc._body);
|
const result = reg.exec(doc._body);
|
||||||
if (result) {
|
if (result) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue