Imports are now standard

This commit is contained in:
JP Hastings-Spital 2024-03-04 21:55:59 +00:00
parent 900aa820a7
commit f99ba8a8f5
6 changed files with 60 additions and 36 deletions

View file

@ -14,20 +14,20 @@ references:
of habit-forming products and that inevitably lead me to the (in)famous neurotransmitter
dopamine. 3/ Before we dive into what dopamine does, let''s first make one thing
clear: dopamine…'
games-problems:
url: https://invertedpassion.com/games-are-problems-people-pay-to-solve/
name: Games are problems people pay to solve
rel: +agree +accurate
skimmable:
url: https://invertedpassion.com/why-you-will-skim-this-article/
name: Why you will skim this article
rel: +agree +accurate
dopamine-and-value-of-work:
url: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4696912/
name: Mesolimbic Dopamine Signals the Value of Work
games-problems:
url: https://invertedpassion.com/games-are-problems-people-pay-to-solve/
rel: +agree +accurate
name: Games are problems people pay to solve
skimmable:
url: https://invertedpassion.com/why-you-will-skim-this-article/
rel: +agree +accurate
name: Why you will skim this article
tags:
- curious
- biology
- curious
---
I really enjoyed reading about dopamine, desire and pleasure here! Its worth a read, even if it slightly veers into the “how to abuse this knowledge for personal gain with your new product” space.
@ -151,7 +151,7 @@ Im not sure I agree that this is _all_ that stories are, but to the extent th
---
> Plus, [why everything looks the same now](https://invertedpassion.com/why-you-will-skim-this-article/).
>
>
> Hint: thats because before beating expectations, you have to meet them.
I dont agree with the base premise here, I think this is inverted. You can set yourself apart from expectations & reset them; if you end up looking like others _then_ you have to meet all the expectations folks have of everyone else, but if you can find a niche and be different enough that people roll back their higher-level expectations, then you can carve out some particularly interesting reward.

View file

@ -12,8 +12,8 @@ references:
ideas.
author: Henrik Karlsson, Johanna Wiberg
tags:
- self-help
- creativity
- self-help
---
@ -32,4 +32,3 @@ This has also put me to thinking about raising kids; how to ensure theres alw
---
> The songs hes looking for are the ones that hes ashamed of liking.

View file

@ -69,4 +69,3 @@ I love the origins of this phrase; a Ren and Stimpy cartoon where Ren (?) has to
I love this concept! It feels like were missing it a lot on the web (see [the webs missing communication faculty](/posts/webs-missing-communication-faculty/)), I fully intend to seek out and recognise people who can be my _epistemic peers_.
(Though I think declaring who they are might be a security risk?)

View file

@ -38,4 +38,3 @@ I plan on taking some every day risks this year & always.
---
> Aliveness is risk, not comfort.

View file

@ -11,9 +11,9 @@ references:
summary: We are stuck in a hell of frictionlessness.
author: P.E. Moskowitz
tags:
- Miriscient
- curious
- grief
- Miriscient
---
@ -30,4 +30,3 @@ I think I've certainly trained myself for a frictionless existence, and have (up
> there are many forces preventing us from feeling abstractly and confusingly and deeply, and from producing things that help others feel so.
I keep finding myself coming back to this thought in particular. I _want_ to feel abstractly and deeply — it feels much more like "living".

View file

@ -56,27 +56,34 @@ var hashtags = regexp.MustCompile(`#\w+`)
func outputArticle(article Article, outputDir string) error {
slug := kebab(article.Title)
hugoPost, err := os.Create(path.Join(outputDir, fmt.Sprintf("%s.md", slug)))
articlePath := path.Join(outputDir, fmt.Sprintf("%s.md", slug))
fm, _ := loadFrontmatter(articlePath)
hugoPost, err := os.Create(articlePath)
if err != nil {
return err
}
fm := FrontMatter{
Title: article.Title,
Date: article.BookmarkDate.Format(time.RFC3339),
BookmarkOf: article.OriginalURL,
References: map[string]Ref{
"bookmark": {
URL: article.OriginalURL,
Type: "entry",
Name: article.OriginalTitle,
Summary: article.OriginalSummary,
Author: article.OriginalAuthor,
},
},
Tags: article.Tags,
if fm.Date == "" {
fm.Date = article.BookmarkDate.Format(time.RFC3339)
}
fm.Title = article.Title
fm.BookmarkOf = article.OriginalURL
fm.Tags = removeDupes(append(fm.Tags, article.Tags...))
if fm.References == nil {
fm.References = make(map[string]Ref)
}
ref := fm.References["bookmark"]
ref.URL = article.OriginalURL
ref.Type = "entry"
ref.Name = article.OriginalTitle
ref.Summary = article.OriginalSummary
ref.Author = article.OriginalAuthor
fm.References["bookmark"] = ref
if !article.PublishDate.IsZero() {
fm.PublishDate = article.PublishDate.Format(time.RFC3339)
}
@ -96,14 +103,14 @@ func outputArticle(article Article, outputDir string) error {
for i, highlight := range article.Highlights {
quote := "> " + strings.ReplaceAll(trimQuote(highlight.Quote), "\n", "\n> ")
fmt.Fprint(hugoPost, "\n"+quote+"\n\n")
fmt.Fprint(hugoPost, "\n"+quote+"\n")
if highlight.Comment != "" {
fmt.Fprint(hugoPost, linkHashtags(highlight.Comment, fm.Tags)+"\n\n")
fmt.Fprint(hugoPost, "\n"+linkHashtags(highlight.Comment, fm.Tags)+"\n")
}
if i < len(article.Highlights)-1 {
fmt.Fprint(hugoPost, "---\n")
fmt.Fprint(hugoPost, "\n---\n")
}
}
@ -112,11 +119,32 @@ func outputArticle(article Article, outputDir string) error {
var allBold = regexp.MustCompile(`\*\*([^*]+)\*\*(\W)?`)
func removeDupes(tags []string) []string {
slices.Sort(tags)
return slices.Compact(tags)
}
func trimQuote(quote string) string {
noTrail := strings.TrimRight(quote, "\n ")
return allBold.ReplaceAllString(noTrail, "$1$2")
}
func loadFrontmatter(path string) (FrontMatter, error) {
f, err := os.Open(path)
if err != nil {
return FrontMatter{}, err
}
defer f.Close()
decoder := yaml.NewDecoder(f)
var fm FrontMatter
if err := decoder.Decode(&fm); err != nil {
return FrontMatter{}, err
}
return fm, nil
}
func linkHashtags(text string, tags []string) string {
return hashtags.ReplaceAllStringFunc(text, func(hashtag string) string {
tags = append(tags, hashtag[1:])
@ -167,7 +195,8 @@ type FrontMatter struct {
type Ref struct {
URL string `yaml:"url"`
Type string `yaml:"type"`
Rel string `yaml:"rel,omitempty"`
Type string `yaml:"type,omitempty"`
Name string `yaml:"name"`
Summary string `yaml:"summary,omitempty"`
Author string `yaml:"author,omitempty"`
@ -295,7 +324,6 @@ func parseResponse(body []byte) ([]Article, string, error) {
}
if len(annotation) == 0 {
fmt.Fprintf(os.Stderr, "No annotation for %s\n", articleURL)
continue
}