Adding auto-summaries for imports

This commit is contained in:
JP Hastings-Spital 2024-10-16 14:07:25 +01:00
parent f58fa877c0
commit 8e2dd5ad7f
25 changed files with 82 additions and 7 deletions

View file

@ -9,14 +9,14 @@ references:
type: entry type: entry
name: A Chess Engine in PostScript name: A Chess Engine in PostScript
summary: Here is a quick overview about the making and inner working of PSChess. summary: Here is a quick overview about the making and inner working of PSChess.
summary: 'A curious person implements a chess program in an unlikely place: on your
printer.'
tags: tags:
- creativity - creativity
- curious - curious
- tech - tech
- why-not - why-not
--- ---
A curious person implements a chess program in an unlikely place: on your printer.
Im always slightly blown away by people who build something because they want to explore and “why not”, rather than for any particular utility. This project is no exception! Im always slightly blown away by people who build something because they want to explore and “why not”, rather than for any particular utility. This project is no exception!
Its been a while since I files this link away for future me to read, and I now conveniently have a printer to be able to try it on, so Ill definitely be reading the follow up post and trying it out if I can! Its been a while since I files this link away for future me to read, and I now conveniently have a printer to be able to try it on, so Ill definitely be reading the follow up post and trying it out if I can!

View file

@ -13,6 +13,8 @@ references:
summary: It has been some time since I posted on this blog.  Writing posts that summary: It has been some time since I posted on this blog.  Writing posts that
are good enough for me to consider posting takes a reasonable amount of effort, are good enough for me to consider posting takes a reasonable amount of effort,
and since my last post I embarked upon a … and since my last post I embarked upon a …
summary: What a wonderful read! Im not a parent (yet?) but I found myself eagerly
reading every section here, despite this articles length!
tags: tags:
- parenthood - parenthood
--- ---

View file

@ -12,6 +12,7 @@ references:
summary: How boundaries became the rules for mental health—and explain everything Lily summary: How boundaries became the rules for mental health—and explain everything Lily
Scherlis Scherlis
author: Lily Scherlis author: Lily Scherlis
summary: How boundaries became the rules for mental health—and explain everything
--- ---
An extremely interesting article that helped me realise how different my definition of what “boundaries” are seems to differ from what contemporary usage is! An extremely interesting article that helped me realise how different my definition of what “boundaries” are seems to differ from what contemporary usage is!

View file

@ -13,6 +13,8 @@ references:
interest in large language models: machine learning systems which produce human-like interest in large language models: machine learning systems which produce human-like
text and dialogue. Applications of...' text and dialogue. Applications of...'
author: Slater, Joe author: Slater, Joe
summary: A well reasoned paper on why AI-generated falsehoods should be called bullshit,
not hallucinations.
tags: tags:
- AI - AI
- Philosophy - Philosophy

View file

@ -12,6 +12,7 @@ references:
summary: Solitude, creativity, Bergman, Grothendieck, and the pursuit of great summary: Solitude, creativity, Bergman, Grothendieck, and the pursuit of great
ideas. ideas.
author: Henrik Karlsson, Johanna Wiberg author: Henrik Karlsson, Johanna Wiberg
summary: Solitude, creativity, Bergman, Grothendieck, and the pursuit of great ideas.
tags: tags:
- creativity - creativity
- self-help - self-help

View file

@ -11,6 +11,7 @@ references:
name: Fancy math doesn't make simple math stop being true name: Fancy math doesn't make simple math stop being true
summary: on butts and instrumental variables summary: on butts and instrumental variables
author: dynomight author: dynomight
summary: on butts and instrumental variables
tags: tags:
- measurement - measurement
--- ---

View file

@ -10,6 +10,8 @@ references:
type: entry type: entry
name: Google shattered human connection name: Google shattered human connection
summary: Open Source Freelancer summary: Open Source Freelancer
summary: An interesting take on why the internet can feel soulless, and some implied
ways to counter that.
tags: tags:
- tech - tech
--- ---

View file

@ -13,6 +13,8 @@ references:
shouldnt host services for others. Yet, I am self-hosting services and I even shouldnt host services for others. Yet, I am self-hosting services and I even
teach people how to do it.' teach people how to do it.'
author: Thibault Martin author: Thibault Martin
summary: A concise and smart article talking to those of us interested in offering
hobby networked services to others.
tags: tags:
- homelab - homelab
- tech - tech

View file

@ -12,6 +12,8 @@ references:
summary: examines claims that the big five personality traits is more scientifically summary: examines claims that the big five personality traits is more scientifically
valid than the myers briggs personality indicator valid than the myers briggs personality indicator
author: dynomight author: dynomight
summary: examines claims that the big five personality traits is more scientifically
valid than the myers briggs personality indicator
--- ---
I fit the eNxP model by this article's assertions, and it feels representative enough to be useful. I like the idea of these tools to label & understand yourself _particularly_ because you can figure out where you _don't_ fit the model/where the label _isn't_ useful. I fit the eNxP model by this article's assertions, and it feels representative enough to be useful. I like the idea of these tools to label & understand yourself _particularly_ because you can figure out where you _don't_ fit the model/where the label _isn't_ useful.

View file

@ -12,6 +12,8 @@ references:
summary: Writing about the big beautiful mess that is making things for the world summary: Writing about the big beautiful mess that is making things for the world
wide web. wide web.
author: Jim Nielsen author: Jim Nielsen
summary: Writing about the big beautiful mess that is making things for the world
wide web.
tags: tags:
- AI - AI
--- ---

View file

@ -10,6 +10,8 @@ references:
name: Limits to economic growth name: Limits to economic growth
summary: Nature Physics, doi:10.1038/s41567-022-01652-6 summary: Nature Physics, doi:10.1038/s41567-022-01652-6
author: Thomas W. Murphy author: Thomas W. Murphy
summary: A fascinating (and relatively short) read on why economic growth has multiple
factors limiting it entire before the end of the century.
tags: tags:
- economics - economics
- learn - learn

View file

@ -12,12 +12,12 @@ references:
summary: The magazine of the science fiction, fantasy, and horror field with news, summary: The magazine of the science fiction, fantasy, and horror field with news,
reviews, and author interviews reviews, and author interviews
author: locusmag author: locusmag
summary: Cory Doctorow describes why money feels so _necessary_, and why cryptocurrencies
dont.
tags: tags:
- economics - economics
- politics - politics
--- ---
Cory Doctorow describes why money feels so _necessary_, and why cryptocurrencies dont.
A very interesting read indeed! Ive not looked into the origins of money before, but Corys explanation of the ideas behind _Debt: The First 5,000 Years_ is extremely thought provoking. It certainly explains why money can feel so… oppressive. A very interesting read indeed! Ive not looked into the origins of money before, but Corys explanation of the ideas behind _Debt: The First 5,000 Years_ is extremely thought provoking. It certainly explains why money can feel so… oppressive.
### Highlights ### Highlights

View file

@ -9,6 +9,8 @@ references:
type: entry type: entry
name: Neologisms name: Neologisms
summary: A collection of interesting words that have recently been coined summary: A collection of interesting words that have recently been coined
summary: I love creating or finding words for niche (or expanding) concepts and areas.
These highlighted ones are particularly great!
tags: tags:
- words - words
--- ---

View file

@ -11,6 +11,7 @@ references:
name: Okay, Color Spaces name: Okay, Color Spaces
summary: What is a “color space?” summary: What is a “color space?”
author: Eric Portis author: Eric Portis
summary: An excellent explanation of colourspaces and their uses today.
tags: tags:
- color - color
--- ---

View file

@ -14,6 +14,8 @@ references:
employs software engineers. Its mission would be to improve the quality, and especially safety, of popular employs software engineers. Its mission would be to improve the quality, and especially safety, of popular
Open-Source software. Open-Source software.
author: Tim Bray author: Tim Bray
summary: This is an inspiring (and well thought through) approach to a problem on
a lot of folks minds after the XZ attack.
tags: tags:
- tech - tech
--- ---

View file

@ -15,6 +15,8 @@ references:
side effects of some technologies that you're probably already becoming familiar side effects of some technologies that you're probably already becoming familiar
with. Note that this is a long blog entry — even by my verbose standards — so with. Note that this is a long blog entry — even by my verbose standards — so
you'll need to hit on the "continue reading" link to see the whole thing.) you'll need to hit on the "continue reading" link to see the whole thing.)
summary: What does the future of technology hold, to a predictive thinker in the year
2007?
--- ---
What does the future of technology hold, to a predictive thinker in the year 2007? What does the future of technology hold, to a predictive thinker in the year 2007?

View file

@ -11,6 +11,8 @@ references:
summary: 'I saw this tweet yesterday from @deepfates, and I am very on board with summary: 'I saw this tweet yesterday from @deepfates, and I am very on board with
this: Watching in real time as “slop” becomes a term of art. the way that “spam” this: Watching in real time as “slop” becomes a term of art. the way that “spam”
…' …'
summary: I will be using this word from here on! Unreviewed AI-generated drivel is
now “slop”.
tags: tags:
- AI - AI
- words - words

View file

@ -11,6 +11,8 @@ references:
name: Some asshole is signing your name to stupid letters name: Some asshole is signing your name to stupid letters
summary: A legal letter of note summary: A legal letter of note
author: Shaun Usher author: Shaun Usher
summary: I love this approach to replying to someone whose message youd rather not
handle directly!
tags: tags:
- comedy - comedy
- communication - communication

View file

@ -11,6 +11,7 @@ references:
name: The home as a place of production name: The home as a place of production
summary: Diverse work and the joy of making summary: Diverse work and the joy of making
author: Karen Rosenkranz author: Karen Rosenkranz
summary: Diverse work and the joy of making
--- ---
Bringing more creation into our homes as a way to feel connected to our surroundings and communities. I couldn't appreciate this article more! Bringing more creation into our homes as a way to feel connected to our surroundings and communities. I couldn't appreciate this article more!

View file

@ -12,6 +12,8 @@ references:
summary: I'm not a fan of the popular Political Compass. Here I explain why, list summary: I'm not a fan of the popular Political Compass. Here I explain why, list
what makes a good 2-by-2 and rederive the meaning of the political left and what makes a good 2-by-2 and rederive the meaning of the political left and
right. Read more (10 min, 3300 words). right. Read more (10 min, 3300 words).
summary: I _really_ like the framing of this political compass & how it provides more
insight into where people exist on it.
--- ---
I _really_ like the framing of this political compass & how it provides more insight into where people exist on it. I _really_ like the framing of this political compass & how it provides more insight into where people exist on it.

View file

@ -11,6 +11,7 @@ references:
name: Breaking the Tyranny of Obviousness name: Breaking the Tyranny of Obviousness
summary: We are stuck in a hell of frictionlessness. summary: We are stuck in a hell of frictionlessness.
author: P.E. Moskowitz author: P.E. Moskowitz
summary: A superb read, especially for me as I look for more depth in life.
tags: tags:
- Miriscient - Miriscient
- curious - curious

View file

@ -11,8 +11,10 @@ references:
name: Frank Chimero · The Webs Grain name: Frank Chimero · The Webs Grain
summary: Frank Chimeros Personal Website summary: Frank Chimeros Personal Website
author: Frank Chimero author: Frank Chimero
summary: A wonderful presentation on the limitations of the web, and how to adapt
to them and foster our joy in the web as a medium. I love it!
--- ---
A wonderful presentation on the limitations of the web, and how to adapt to them and foster our joy in the web as a medium. I love it!
### Highlights ### Highlights

View file

@ -107,7 +107,10 @@ func outputArticle(article Article, outputDir string) error {
fm.Date = article.BookmarkDate.Format(time.RFC3339) fm.Date = article.BookmarkDate.Format(time.RFC3339)
} }
article.Annotation = strings.TrimSpace(article.Annotation) summary, body := shared.ExtractSummary(article.OriginalSummary, strings.TrimSpace(article.Annotation))
if fm.Summary == "" {
fm.Summary = summary
}
if len(fm.Title) == 0 { if len(fm.Title) == 0 {
fm.Emoji, fm.Title = artEmoji, artTitle fm.Emoji, fm.Title = artEmoji, artTitle
@ -138,7 +141,7 @@ func outputArticle(article Article, outputDir string) error {
} }
fmt.Fprint(hugoPost, "---\n") fmt.Fprint(hugoPost, "---\n")
fmt.Fprintln(hugoPost, linkHashtags(article.Annotation, fm.Tags)) fmt.Fprintln(hugoPost, linkHashtags(body, fm.Tags))
if len(article.Highlights) > 0 { if len(article.Highlights) > 0 {
fmt.Fprint(hugoPost, "\n### Highlights\n") fmt.Fprint(hugoPost, "\n### Highlights\n")

View file

@ -74,3 +74,21 @@ func ExtractLeadingEmoji(str string) (string, string) {
return parts[0], strings.TrimSpace(parts[1]) return parts[0], strings.TrimSpace(parts[1])
} }
const maxSummaryLength = 140
func ExtractSummary(inSummary, inBody string) (outSummary, outBody string) {
outBody = inBody
if len(inSummary) <= maxSummaryLength {
outSummary = inSummary
}
parts := strings.SplitN(inBody, "\n\n", 2)
if len(parts[0]) <= maxSummaryLength {
outSummary = parts[0]
parts = append(parts, parts[0])
outBody = parts[1]
}
return outSummary, outBody
}

View file

@ -23,3 +23,23 @@ func TestExtractLeadingEmoji(t *testing.T) {
assert.Equal(t, c[2], text) assert.Equal(t, c[2], text)
} }
} }
const someLongText = "Here's some longer text that will stand in for a body of a post. The first paragraph is longer than 140 characters, but it also has additional paragraphs.\n\nLike this one."
func TestExtractSummary(t *testing.T) {
originalSummary := "The original summary, as provided by the article."
shortSummary := "Some short summary."
cases := [][]string{
{"Short summary", originalSummary, shortSummary + "\n\n" + someLongText, shortSummary, someLongText},
{"No summary", originalSummary, someLongText, originalSummary, someLongText},
{"Only summary", originalSummary, shortSummary, shortSummary, shortSummary},
{"Long original summary, no summary in my text", "original" + someLongText, "mine" + someLongText, "", "mine" + someLongText},
}
for _, c := range cases {
summary, body := shared.ExtractSummary(c[1], c[2])
assert.Equal(t, c[3], summary)
assert.Equal(t, c[4], body)
}
}