Skip to content

Commit f11b7af

Browse files
authored
Merge pull request #3889 from omnivore-app/fix/web-notes-and-fonts
Fix notebook export, add Super Notes Pro font'
2 parents 9a62d11 + 6091ddd commit f11b7af

File tree

6 files changed

+38
-3
lines changed

6 files changed

+38
-3
lines changed

packages/web/components/templates/article/NotebookHeader.tsx

+15-3
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,24 @@ export const NotebookHeader = (props: NotebookHeaderProps) => {
2727

2828
const exportHighlights = useCallback(() => {
2929
if (articleData?.article.article.highlights) {
30-
const markdown = highlightsAsMarkdown(
30+
let preamble = ''
31+
32+
if (articleData?.article.article.title) {
33+
preamble += `## ${articleData?.article.article.title}\n`
34+
}
35+
if (
36+
articleData?.article.article.contentReader == 'WEB' &&
37+
articleData?.article.article.originalArticleUrl
38+
) {
39+
preamble += `URL: ${articleData?.article.article.originalArticleUrl}\n`
40+
}
41+
42+
const highlights = highlightsAsMarkdown(
3143
articleData?.article.article.highlights
3244
)
33-
if (markdown.length > 1) {
45+
if (preamble.length + highlights.length > 1) {
3446
;(async () => {
35-
await navigator.clipboard.writeText(markdown)
47+
await navigator.clipboard.writeText(preamble + '\n\n' + highlights)
3648
showSuccessToast('Highlights and notes copied')
3749
})()
3850
} else {

packages/web/components/templates/article/ReaderSettingsControl.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const FONT_FAMILIES = [
4848
'IBMPlexSans',
4949
'Fraunces',
5050
'Literata',
51+
'SuperNotesPro',
5152
]
5253

5354
type SettingsProps = {
Binary file not shown.
Binary file not shown.
Binary file not shown.

packages/web/styles/globals.css

+22
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,28 @@ div#appleid-signin {
418418
src: url('/static/fonts/Literata/Literata-Italic.ttf');
419419
}
420420

421+
@font-face {
422+
font-family: 'SuperNotesPro';
423+
font-weight: 400;
424+
font-style: normal;
425+
src: url('/static/fonts/SNPro/SNPro-VariableRegular.ttf');
426+
}
427+
428+
@font-face {
429+
font-family: 'SuperNotesPro';
430+
font-weight: 700;
431+
font-style: bold;
432+
src: url('/static/fonts/SNPro/SNPro-Bold.ttf');
433+
}
434+
435+
436+
@font-face {
437+
font-family: 'SuperNotesPro';
438+
font-weight: 400;
439+
font-style: italic;
440+
src: url('/static/fonts/SNPro/SNPro-Italic.ttf');
441+
}
442+
421443
@font-face {
422444
font-family: 'FuturaBold';
423445
src: url('/static/fonts/FuturaBold/FuturaBold.otf');

0 commit comments

Comments
 (0)