Skip to content

Commit

Permalink
Merge pull request #3889 from omnivore-app/fix/web-notes-and-fonts
Browse files Browse the repository at this point in the history
Fix notebook export, add Super Notes Pro font'
  • Loading branch information
jacksonh committed May 2, 2024
2 parents 9a62d11 + 6091ddd commit f11b7af
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/web/components/templates/article/NotebookHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,24 @@ export const NotebookHeader = (props: NotebookHeaderProps) => {

const exportHighlights = useCallback(() => {
if (articleData?.article.article.highlights) {
const markdown = highlightsAsMarkdown(
let preamble = ''

if (articleData?.article.article.title) {
preamble += `## ${articleData?.article.article.title}\n`
}
if (
articleData?.article.article.contentReader == 'WEB' &&
articleData?.article.article.originalArticleUrl
) {
preamble += `URL: ${articleData?.article.article.originalArticleUrl}\n`
}

const highlights = highlightsAsMarkdown(
articleData?.article.article.highlights
)
if (markdown.length > 1) {
if (preamble.length + highlights.length > 1) {
;(async () => {
await navigator.clipboard.writeText(markdown)
await navigator.clipboard.writeText(preamble + '\n\n' + highlights)
showSuccessToast('Highlights and notes copied')
})()
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const FONT_FAMILIES = [
'IBMPlexSans',
'Fraunces',
'Literata',
'SuperNotesPro',
]

type SettingsProps = {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
22 changes: 22 additions & 0 deletions packages/web/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,28 @@ div#appleid-signin {
src: url('/static/fonts/Literata/Literata-Italic.ttf');
}

@font-face {
font-family: 'SuperNotesPro';
font-weight: 400;
font-style: normal;
src: url('/static/fonts/SNPro/SNPro-VariableRegular.ttf');
}

@font-face {
font-family: 'SuperNotesPro';
font-weight: 700;
font-style: bold;
src: url('/static/fonts/SNPro/SNPro-Bold.ttf');
}


@font-face {
font-family: 'SuperNotesPro';
font-weight: 400;
font-style: italic;
src: url('/static/fonts/SNPro/SNPro-Italic.ttf');
}

@font-face {
font-family: 'FuturaBold';
src: url('/static/fonts/FuturaBold/FuturaBold.otf');
Expand Down

0 comments on commit f11b7af

Please sign in to comment.