Skip to content

Commit

Permalink
move library to end
Browse files Browse the repository at this point in the history
  • Loading branch information
TodePond committed Jan 25, 2025
1 parent bd26ea3 commit a52ed26
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ function getDocumentText(view) {

export function getFlokLink() {
const prettyDate = getPrettyDate();
const prefix = `// "nudel ${prettyDate}" @by pastagang\n//\n${stdSource}\n`;
const prefix = `// "nudel ${prettyDate}" @by pastagang\n`;

const panels = [];
const targets = [];
pastamirror.currentEditors.forEach((it, key) => {
panels.push(`${key == '1' ? prefix : ''}${getDocumentText(it.view).join('\n')}`);
panels.push(
`${key == '1' ? prefix : ''}${getDocumentText(it.view).join('\n')}${key === '1' ? '\n\n\n' + stdSource : ''}`,
);
targets.push(it.doc.target);
});
return `flok.cc#targets=${targets.join(
Expand Down Expand Up @@ -68,12 +70,14 @@ export function downloadAsFile(txt, { fileName = `nudel-export-${getPrettyDate()

export function getCode(filter) {
const prettyDate = getPrettyDate();
const headline = `// "nudel ${prettyDate}" @by pastagang\n${stdSource}\n`;
const headline = `// "nudel ${prettyDate}" @by pastagang\n`;
let documents = session.getDocuments();
if (filter) {
documents = documents.filter(filter);
}
return documents.reduce((acc, doc) => `${acc}\n//pane ${doc.id}\n${doc.content || ''}`, headline);
return (
documents.reduce((acc, doc) => `${acc}\n//pane ${doc.id}\n${doc.content || ''}`, headline) + '\n\n\n' + stdSource
);
}

exportCopyButton.addEventListener('click', () => {
Expand Down

0 comments on commit a52ed26

Please sign in to comment.