generated from errata-ai/Hugo
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP WIP WIP WIP WIP WIP WIP WIP WIP WIP
- Loading branch information
Showing
15 changed files
with
172 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
Hugo.zip | ||
MDX.zip | ||
/testdata/styles | ||
/testdata/out.md | ||
|
||
# Binaries for programs and plugins | ||
*.exe | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[formats] | ||
mdx = md | ||
|
||
[*.mdx] | ||
CommentDelimiters = {/*, */} | ||
|
||
# Exclude: | ||
# | ||
# `import ...`, `export ...` | ||
# `<Component ... />` | ||
# `<Component>...</Component>` | ||
# `{ ... }` | ||
TokenIgnores = (?sm)((?:import|export) .+?$), \ | ||
(?<!`)(<\w+ ?.+ ?\/>)(?!`), \ | ||
(<[A-Z]\w+>.+?<\/[A-Z]\w+>) | ||
|
||
# Exclude: | ||
# | ||
# `<Component \n ... />` | ||
BlockIgnores = (?sm)^(<\w+\n .*\s\/>)$, \ | ||
(?sm)^({.+.*}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
# Hugo | ||
# MDX | ||
|
||
A Vale configuration for Hugo-generated static sites. | ||
A Vale configuration for sites using [MDX][1]. | ||
|
||
## Testing | ||
|
||
``` | ||
$ make test | ||
``` | ||
|
||
[1]: https://mdxjs.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,3 @@ | ||
module github.com/errata-ai/Hugo | ||
module github.com/errata-ai/MDX | ||
|
||
go 1.17 | ||
|
||
require github.com/google/go-cmdtest v0.4.0 | ||
|
||
require ( | ||
github.com/google/go-cmp v0.3.1 // indirect | ||
github.com/google/renameio v0.1.0 // indirect | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
package main | ||
|
||
import "os" | ||
import ( | ||
"errors" | ||
"os" | ||
"path/filepath" | ||
) | ||
|
||
func cdf() int { | ||
os.Chdir(os.Args[1]) | ||
return 0 | ||
func main() { | ||
expected := filepath.Join("testdata", "in.md") | ||
observed := filepath.Join("testdata", "out.md") | ||
|
||
// Read the expected and observed files | ||
expectedContent, err := os.ReadFile(expected) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
observedContent, err := os.ReadFile(observed) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
// Compare the contents of the files | ||
if string(expectedContent) != string(observedContent) { | ||
panic(errors.New("expected and observed files do not match")) | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
StylesPath = styles | ||
|
||
Packages = ../Hugo.zip | ||
Packages = ../MDX.zip | ||
|
||
[*.md] | ||
[*.mdx] | ||
BasedOnStyles = Vale |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Hello, world! | ||
|
||
`import {External} from './some/place.js'` | ||
`import {Chart} from './chart.js'` | ||
`import population from './population.js'` | ||
|
||
`export const pi = 3.14` | ||
`export const Local = properties => <span style={{color: 'red'}} {...properties} />` | ||
|
||
`<Chart data={population} label={'Something with ' + pi} />` | ||
|
||
An `<External>external</External>` component and a `<Local>local one</Local>`. | ||
|
||
<div className="note"> | ||
> Some notable things in a block quote! | ||
</div> | ||
`<Welcome name="Venus" />` | ||
`<Welcome name="Mars" />` | ||
|
||
`<MyComponent id="123" />` | ||
|
||
You can also use objects with components, such as the `thisOne` component on | ||
the `myComponents` object: `<myComponents.thisOne />` | ||
|
||
|
||
``` | ||
<Component | ||
open | ||
x={1} | ||
label={'this is a string, *not* markdown!'} | ||
icon={`<Icon />`} | ||
/> | ||
``` | ||
|
||
|
||
Two 🍰 is: {Math.PI * 2} | ||
|
||
|
||
``` | ||
{(function () { | ||
const guess = Math.random() | ||
if (guess > 0.66) { | ||
return <span style={{color: 'tomato'}}>Look at us.</span> | ||
} | ||
if (guess > 0.33) { | ||
return <span style={{color: 'violet'}}>Who would have guessed?!</span> | ||
} | ||
return <span style={{color: 'goldenrod'}}>Not me.</span> | ||
})()} | ||
``` | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.