Skip to content

Commit

Permalink
Merge branch 'master' into pr/jonathaningram/56
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/index.test.js
  • Loading branch information
ndelangen committed May 24, 2019
2 parents 0b7bfaa + e29999b commit b868930
Show file tree
Hide file tree
Showing 12 changed files with 5,300 additions and 16,918 deletions.
23 changes: 21 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
{
"presets": ["env", "stage-2", "react"],
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"env": {
"production": {
"ignore": [
"**/*.test.js"
]
}
}
},
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-json-strings",
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions"
]
}
16 changes: 0 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,6 @@ defaults: &defaults
version: 2

jobs:
size:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}
- run: yarn size

test:
<<: *defaults
steps:
Expand Down Expand Up @@ -55,5 +40,4 @@ workflows:
build_accept_deploy:
jobs:
- test
- size
- lint
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ compiled.toc // The table of contents, based on usage of headers
```

### Components
You can also add your own custom components. You do this by importing `marksy/components`. This build of marksy includes babel transpiler which will convert any HTML to elements and allow for custom components:
You can also add your own custom components. You do this by importing `marksy/jsx`. This build of marksy includes babel transpiler which will convert any HTML to elements and allow for custom components:

<pre lang="js"><code>
import React, {createElement} from 'react'
Expand Down Expand Up @@ -89,7 +89,7 @@ You can take one step further and create components wherever you want in the mar

<pre lang="js"><code>
import React, {createElement} from 'react'
import marksy from 'marksy/components'
import marksy from 'marksy/jsx'

const compile = marksy({
createElement,
Expand Down Expand Up @@ -118,7 +118,7 @@ You might need to pass in general information to your custom elements and compon

```js
import React, {createElement} from 'react'
import marksy from 'marksy/components'
import marksy from 'marksy/jsx'

const compile = marksy({
createElement,
Expand Down Expand Up @@ -147,7 +147,7 @@ import {createElement} from 'react'
import 'highlight.js/styles/github.css';
import hljs from 'highlight.js/lib/highlight';
import hljsJavascript from 'highlight.js/lib/languages/javascript';
import marksy from 'marksy/components'
import marksy from 'marksy/jsx'

hljs.registerLanguage('javascript', hljsJavascript);

Expand All @@ -173,5 +173,5 @@ Meaning that the `code` element is added a classname based on the language.

## Developing
1. Clone repo
2. `npm install`
3. `npm start` -> localhost:8080 (development app)
2. `yarn install`
3. `yarn start` -> localhost:8080 (development app)
5 changes: 4 additions & 1 deletion app/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable react/destructuring-assignment */
/* eslint-disable import/no-extraneous-dependencies */

import 'highlight.js/styles/github.css';
Expand All @@ -7,8 +8,8 @@ import React from 'react';
import { render } from 'react-dom';

// eslint-disable-next-line import/no-unresolved
import marksy from 'marksy/components';
import { document } from 'global';
import marksy from '../components';

hljs.registerLanguage('javascript', hljsJavascript);

Expand Down Expand Up @@ -64,12 +65,14 @@ class App extends React.Component {
value: demo,
};
}

onTextareaChange(event) {
this.setState({
tree: compile(event.target.value).tree,
value: event.target.value,
});
}

render() {
return (
<div>
Expand Down
Loading

0 comments on commit b868930

Please sign in to comment.