Compare commits
No commits in common. "2e9520a4f1c8fae47e1cf7bf503e608493338dc5" and "0112d23229567090d110c3f3bfa5dc0b5f41f7e4" have entirely different histories.
2e9520a4f1
...
0112d23229
@ -1,7 +1,5 @@
|
|||||||
## Elm
|
## Elm
|
||||||
|
|
||||||
These are my notes on the functional programming language Elm.
|
|
||||||
|
|
||||||
* [Formatting](./formatting)
|
* [Formatting](./formatting)
|
||||||
* [Maybe.andThen](./maybeandthen)
|
* [Maybe.andThen](./maybeandthen)
|
||||||
* [Maybe.map](./maybemap)
|
* [Maybe.map](./maybemap)
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
### Elm
|
### Elm
|
||||||
|
|
||||||
Dit zijn mijn notities van de functionele programmeertaal Haskell.
|
|
||||||
|
|
||||||
* [Formatting](./formatting)
|
* [Formatting](./formatting)
|
||||||
* [Maybe.andThen](./maybeandthen)
|
* [Maybe.andThen](./maybeandthen)
|
||||||
* [Maybe.map](./maybemap)
|
* [Maybe.map](./maybemap)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
### Haskell
|
### Haskell
|
||||||
|
|
||||||
These are my notes on the functional programming language Haskell.
|
I am learing functional programming and Haskell, these are my notes on the language.
|
||||||
|
|
||||||
* [Curried Functions](./curried-functions)
|
* [Curried Functions](./curried-functions)
|
||||||
@ -1,5 +1,5 @@
|
|||||||
### Haskell
|
### Haskell
|
||||||
|
|
||||||
Dit zijn mijn notities van de functionele programmeertaal Haskell.
|
I ben functioneel programmeren en Haskell aan het leren, dit zijn mijn notities van deze taal.
|
||||||
|
|
||||||
* [Curried Functions](./curried-functions)
|
* [Curried Functions](./curried-functions)
|
||||||
@ -4,7 +4,6 @@ import SyntaxHighlighter from 'react-syntax-highlighter';
|
|||||||
// https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/HEAD/AVAILABLE_STYLES_HLJS.MD
|
// https://github.com/react-syntax-highlighter/react-syntax-highlighter/blob/HEAD/AVAILABLE_STYLES_HLJS.MD
|
||||||
import { docco, dracula } from 'react-syntax-highlighter/dist/esm/styles/hljs';
|
import { docco, dracula } from 'react-syntax-highlighter/dist/esm/styles/hljs';
|
||||||
import { useTheme } from '../ThemeContext';
|
import { useTheme } from '../ThemeContext';
|
||||||
import { getLanguage } from '../Language/Language';
|
|
||||||
|
|
||||||
const MySection = ({ children }) => {
|
const MySection = ({ children }) => {
|
||||||
return (<section>{children}</section>);
|
return (<section>{children}</section>);
|
||||||
@ -99,9 +98,6 @@ const MyTable = ({ children }) => {
|
|||||||
|
|
||||||
const MarkdownPage = ({ md }) => {
|
const MarkdownPage = ({ md }) => {
|
||||||
const [markdownContent, setPost] = useState('');
|
const [markdownContent, setPost] = useState('');
|
||||||
const [pageNotFound, setPageNotFound] = useState(false);
|
|
||||||
const [errorPageContent, setErrorPage] = useState('');
|
|
||||||
const language = getLanguage();
|
|
||||||
|
|
||||||
// causes 3 calls somehow...
|
// causes 3 calls somehow...
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -112,29 +108,9 @@ const MarkdownPage = ({ md }) => {
|
|||||||
.then(res => setPost(res))
|
.then(res => setPost(res))
|
||||||
.catch(err => console.log(err));
|
.catch(err => console.log(err));
|
||||||
})
|
})
|
||||||
.catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
setPageNotFound(true);
|
|
||||||
|
|
||||||
import(`./Other/${language}/page-not-found.md`)
|
|
||||||
.then(res => {
|
|
||||||
fetch(res.default)
|
|
||||||
.then(res => res.text())
|
|
||||||
.then(res => setErrorPage(res))
|
|
||||||
.catch(err => console.log(err));
|
|
||||||
})
|
|
||||||
.catch(err => console.log(err));
|
.catch(err => console.log(err));
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
if (pageNotFound) {
|
|
||||||
return (
|
|
||||||
<Markdown>
|
|
||||||
{errorPageContent}
|
|
||||||
</Markdown>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return (
|
return (
|
||||||
<Markdown
|
<Markdown
|
||||||
options={{
|
options={{
|
||||||
@ -172,7 +148,6 @@ const MarkdownPage = ({ md }) => {
|
|||||||
{markdownContent}
|
{markdownContent}
|
||||||
</Markdown>
|
</Markdown>
|
||||||
)
|
)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default MarkdownPage;
|
export default MarkdownPage;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user