mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-09 01:35:56 +01:00
Adding auto-summaries for imports
This commit is contained in:
parent
f58fa877c0
commit
8e2dd5ad7f
25 changed files with 82 additions and 7 deletions
|
@ -9,14 +9,14 @@ references:
|
|||
type: entry
|
||||
name: A Chess Engine in PostScript
|
||||
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:
|
||||
- creativity
|
||||
- curious
|
||||
- tech
|
||||
- why-not
|
||||
---
|
||||
A curious person implements a chess program in an unlikely place: on your printer.
|
||||
|
||||
I’m 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!
|
||||
|
||||
It’s 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 I’ll definitely be reading the follow up post and trying it out if I can!
|
||||
|
|
|
@ -13,6 +13,8 @@ references:
|
|||
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,
|
||||
and since my last post I embarked upon a …
|
||||
summary: What a wonderful read! I’m not a parent (yet?) but I found myself eagerly
|
||||
reading every section here, despite this article’s length!
|
||||
tags:
|
||||
- parenthood
|
||||
---
|
||||
|
|
|
@ -12,6 +12,7 @@ references:
|
|||
summary: How boundaries became the rules for mental health—and explain everything 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!
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@ references:
|
|||
interest in large language models: machine learning systems which produce human-like
|
||||
text and dialogue. Applications of...'
|
||||
author: Slater, Joe
|
||||
summary: A well reasoned paper on why AI-generated falsehoods should be called bullshit,
|
||||
not hallucinations.
|
||||
tags:
|
||||
- AI
|
||||
- Philosophy
|
||||
|
|
|
@ -12,6 +12,7 @@ references:
|
|||
summary: Solitude, creativity, Bergman, Grothendieck, and the pursuit of great
|
||||
ideas.
|
||||
author: Henrik Karlsson, Johanna Wiberg
|
||||
summary: Solitude, creativity, Bergman, Grothendieck, and the pursuit of great ideas.
|
||||
tags:
|
||||
- creativity
|
||||
- self-help
|
||||
|
|
|
@ -11,6 +11,7 @@ references:
|
|||
name: Fancy math doesn't make simple math stop being true
|
||||
summary: on butts and instrumental variables
|
||||
author: dynomight
|
||||
summary: on butts and instrumental variables
|
||||
tags:
|
||||
- measurement
|
||||
---
|
||||
|
|
|
@ -10,6 +10,8 @@ references:
|
|||
type: entry
|
||||
name: Google shattered human connection
|
||||
summary: Open Source Freelancer
|
||||
summary: An interesting take on why the internet can feel soulless, and some implied
|
||||
ways to counter that.
|
||||
tags:
|
||||
- tech
|
||||
---
|
||||
|
|
|
@ -13,6 +13,8 @@ references:
|
|||
shouldn’t host services for others. Yet, I am self-hosting services and I even
|
||||
teach people how to do it.'
|
||||
author: Thibault Martin
|
||||
summary: A concise and smart article talking to those of us interested in offering
|
||||
hobby networked services to others.
|
||||
tags:
|
||||
- homelab
|
||||
- tech
|
||||
|
|
|
@ -12,6 +12,8 @@ references:
|
|||
summary: examines claims that the big five personality traits is more scientifically
|
||||
valid than the myers briggs personality indicator
|
||||
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.
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ references:
|
|||
summary: Writing about the big beautiful mess that is making things for the world
|
||||
wide web.
|
||||
author: Jim Nielsen
|
||||
summary: Writing about the big beautiful mess that is making things for the world
|
||||
wide web.
|
||||
tags:
|
||||
- AI
|
||||
---
|
||||
|
|
|
@ -10,6 +10,8 @@ references:
|
|||
name: Limits to economic growth
|
||||
summary: Nature Physics, doi:10.1038/s41567-022-01652-6
|
||||
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:
|
||||
- economics
|
||||
- learn
|
||||
|
|
|
@ -12,12 +12,12 @@ references:
|
|||
summary: The magazine of the science fiction, fantasy, and horror field with news,
|
||||
reviews, and author interviews
|
||||
author: locusmag
|
||||
summary: Cory Doctorow describes why money feels so _necessary_, and why cryptocurrencies
|
||||
don’t.
|
||||
tags:
|
||||
- economics
|
||||
- politics
|
||||
---
|
||||
Cory Doctorow describes why money feels so _necessary_, and why cryptocurrencies don’t.
|
||||
|
||||
A very interesting read indeed! I’ve not looked into the origins of money before, but Cory’s 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
|
||||
|
|
|
@ -9,6 +9,8 @@ references:
|
|||
type: entry
|
||||
name: Neologisms
|
||||
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:
|
||||
- words
|
||||
---
|
||||
|
|
|
@ -11,6 +11,7 @@ references:
|
|||
name: Okay, Color Spaces
|
||||
summary: What is a “color space?”
|
||||
author: Eric Portis
|
||||
summary: An excellent explanation of colourspaces and their uses today.
|
||||
tags:
|
||||
- color
|
||||
---
|
||||
|
|
|
@ -14,6 +14,8 @@ references:
|
|||
employs software engineers. Its mission would be to improve the quality, and especially safety, of popular
|
||||
Open-Source software.
|
||||
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:
|
||||
- tech
|
||||
---
|
||||
|
|
|
@ -15,6 +15,8 @@ references:
|
|||
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
|
||||
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?
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@ references:
|
|||
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”
|
||||
…'
|
||||
summary: I will be using this word from here on! Unreviewed AI-generated drivel is
|
||||
now “slop”.
|
||||
tags:
|
||||
- AI
|
||||
- words
|
||||
|
|
|
@ -11,6 +11,8 @@ references:
|
|||
name: Some asshole is signing your name to stupid letters
|
||||
summary: A legal letter of note
|
||||
author: Shaun Usher
|
||||
summary: I love this approach to replying to someone whose message you’d rather not
|
||||
handle directly!
|
||||
tags:
|
||||
- comedy
|
||||
- communication
|
||||
|
|
|
@ -11,6 +11,7 @@ references:
|
|||
name: The home as a place of production
|
||||
summary: Diverse work and the joy of making
|
||||
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!
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ references:
|
|||
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
|
||||
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.
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ references:
|
|||
name: Breaking the Tyranny of Obviousness
|
||||
summary: We are stuck in a hell of frictionlessness.
|
||||
author: P.E. Moskowitz
|
||||
summary: A superb read, especially for me as I look for more depth in life.
|
||||
tags:
|
||||
- Miriscient
|
||||
- curious
|
||||
|
|
|
@ -11,8 +11,10 @@ references:
|
|||
name: Frank Chimero · The Web’s Grain
|
||||
summary: Frank Chimero’s Personal Website
|
||||
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
|
||||
|
||||
|
|
|
@ -107,7 +107,10 @@ func outputArticle(article Article, outputDir string) error {
|
|||
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 {
|
||||
fm.Emoji, fm.Title = artEmoji, artTitle
|
||||
|
@ -138,7 +141,7 @@ func outputArticle(article Article, outputDir string) error {
|
|||
}
|
||||
|
||||
fmt.Fprint(hugoPost, "---\n")
|
||||
fmt.Fprintln(hugoPost, linkHashtags(article.Annotation, fm.Tags))
|
||||
fmt.Fprintln(hugoPost, linkHashtags(body, fm.Tags))
|
||||
|
||||
if len(article.Highlights) > 0 {
|
||||
fmt.Fprint(hugoPost, "\n### Highlights\n")
|
||||
|
|
|
@ -74,3 +74,21 @@ func ExtractLeadingEmoji(str string) (string, string) {
|
|||
|
||||
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
|
||||
}
|
||||
|
|
|
@ -23,3 +23,23 @@ func TestExtractLeadingEmoji(t *testing.T) {
|
|||
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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue