Skip to content

Instantly share code, notes, and snippets.

View eleanorkonik's full-sized avatar

Eleanor Konik eleanorkonik

View GitHub Profile
@eleanorkonik
eleanorkonik / gist:b713de37c9a2629ff5d35b2850b3a3e9
Created January 30, 2022 15:05
readwise Highlight template
### {% if highlight_location != "View Highlight" and highlight_location != "View Tweet" %}{{highlight_location}}{% else %}id{{highlight_id}}{% endif %}
> {{ highlight_text }}
{% if highlight_note %}
- [n] {{ highlight_note }}
{% endif %}
{% if highlight_location and highlight_location_url %} * [{{highlight_location}}]({{highlight_location_url}}){% elif highlight_location %} ({{highlight_location}}){% endif %}
@eleanorkonik
eleanorkonik / readwise-settings.md
Created February 4, 2022 15:05
Eleanor's Readwise Settings

File name

{{title|replace(""","")|replace(""","")|replace("'","")|replace("'","")|truncate(127)}} by {{author|truncate(120)}}

I do this so that weird characters or overly-long file names don't break dropbox or git, since Readwise doesn't natively sanitize things.

Page metadata

Metadata

module.exports = async (params) => {
console.log("Starting...")
console.log(params);
const currentFile = params.app.workspace.getActiveFile();
if (!currentFile) {
new Notice("No active file.");
return;
}
console.log("Found active file: ", currentFile.basename);
```dataviewjs
//get all md files in vault
const files = app.vault.getMarkdownFiles()
//create an array with the filename and lines that include the desired tag
let arr = files.map(async(file) => {
const content = await app.vault.cachedRead(file)
//turn all the content into an array
let lines = await content.split("\n").filter(line => line.includes("- [?]"))
return ["[["+file.name.split(".")[0]+"]]", lines]
@eleanorkonik
eleanorkonik / processing-prioritization
Created May 24, 2022 14:23
Find non-existent notes with multiple files linking to them... and readwise imports with lots of useful annotations
```dataview
TABLE file.inlinks AS Inlinks, file.outlinks AS Outlinks, file.tags AS Tags
FROM "10 Pending"
WHERE length(file.inlinks) > 0 OR length(file.outlinks) > 1 Or length(file.tags) > 2
SORT file.size ASC
```
```dataviewjs
const count = 2;
let d = {};