Skip to content

Instantly share code, notes, and snippets.

Avatar

Eleanor Konik eleanorkonik

View GitHub Profile
@eleanorkonik
eleanorkonik / processing-prioritization
Created May 24, 2022
Find non-existent notes with multiple files linking to them... and readwise imports with lots of useful annotations
View processing-prioritization
```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 = {};
View dataview query for - [?]
```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]
View Zettelizer.js
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);
@eleanorkonik
eleanorkonik / readwise-settings.md
Created Feb 4, 2022
Eleanor's Readwise Settings
View readwise-settings.md

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

View gist:b713de37c9a2629ff5d35b2850b3a3e9
### {% 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 %}