Skip to content

Commit

Permalink
Merge pull request #49 from opticrd/dev-ci-cd
Browse files Browse the repository at this point in the history
Dev ci cd
  • Loading branch information
ChristianDC13 authored Mar 23, 2022
2 parents b2e0a25 + 21c2597 commit d499629
Show file tree
Hide file tree
Showing 5 changed files with 9,380 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/clean.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
uses: rlespinasse/github-slug-action@v3.x

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@main
uses: google-github-actions/setup-gcloud@master
with:
project_id: ${{ secrets.GCP_PROJECT }}
service_account_key: ${{ secrets.GAR_JSON_KEY }}
Expand Down
23 changes: 1 addition & 22 deletions components/apis/markdown-viewer.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,11 @@
import { useEffect } from 'react'
import { marked } from 'marked';

export default function MarkdownViewer({ content }: { content: string }) {
const stylesheetTag = '<link rel="stylesheet" href="/css/markdown.css" />'
const html = stylesheetTag + marked.parse(content)

const updateSize = (frame: any) => {
frame.style.height =
420 + frame.contentWindow.document.body.scrollHeight + 'px'
frame.style.width = '100%'
}
useEffect(() => {
const frame = document.getElementById('md-frame') as any

const doc = frame ? frame.contentWindow?.document : null
if (doc) {
doc.open()
doc.write(html)
doc.close()

updateSize(frame)
}
return () => { }
}, [content, html])

return (
<div className="relative">
<iframe id="md-frame"></iframe>
<div className="relative markdown-viewer" dangerouslySetInnerHTML={{ __html: html }}>
</div>
)
}
5,225 changes: 5,224 additions & 1 deletion public/css/markdown.css

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions public/css/markdown.css.map

Large diffs are not rendered by default.

Loading

0 comments on commit d499629

Please sign in to comment.