Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
demonstrate styling
  • Loading branch information
priyanshunayan committed Jan 27, 2021
commit a5271a7f0f6df77d97dd2cad195dd5eedb0fff5a
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,6 @@ yarn-error.log
.pnp.js
# Yarn Integrity file
.yarn-integrity

#package-lock
package-lock.json
6 changes: 4 additions & 2 deletions docs/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ module.exports = {
{
resolve: "gatsby-theme-docz",
options: {

}
}

]
],
flags: {
THE_FLAG: false
}
};
24 changes: 13 additions & 11 deletions docs/src/content/modules/hydrus.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
import React from 'react';
import ReactDOM from 'react-dom';
import DOMPurify from 'dompurify';
const fetch = require("node-fetch");

export default class Docs extends React.Component{

state = {
finaldata: 1,
};
html = "";

async componentDidMount(){
const data = await fetch("https://readthedocs.org/api/v2/embed/?url=https://hydrus.readthedocs.io/en/latest/hydrus.html",

).then(response => {return response.json()} );
this.setState({finaldata : data})
componentDidMount(){
fetch("https://cors-anywhere.herokuapp.com/"+"https://readthedocs.org/api/v2/embed/?project=hydra-python-core&version=develop&doc=index&section=Welcome to hydra-python-core’s documentation!"
).then(response => {
return response.json();
}).then(data => {
this.html = data.content[0];
console.log(data);
}
})
}

render()
{
return(
<div dangerouslySetInnerHTML={{__html: DOMPurify.sanitize(this.state.finaldata.content)}}></div>
<div dangerouslySetInnerHTML={{
__html: this.html
}}>
</div>
);
}

Expand Down
3 changes: 3 additions & 0 deletions docs/src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
* {
font-family: "Roboto", sans-serif !important;
}
a {
color: red;
}