# My Book Summaries in Roam Using Tiago's Progressive Summarization **THIS POST WAS UPDATED ON JANUARY 8 2020.** - There was an error in the Roam42 Smart Block. This is now corrected.  - The SmartBlock is now even smarter.  - When you run it, you are prompted to specify the highlight separator. If there are multiple highlights within a paragraph you can specify how it should appear in the stripped output.  - You are also prompted to remove **bolding** of text.  - The SmartBlock should now be run as a child node of a block that contains the title of the page with the literature highlights. - A [Roam.JSON](https://zsviczian.github.io/ProgressiveSummarization.zip) is included to make it easier to install the SmartBlock. - The ["how to" video](#howto) demonstrating the installation and the execution of the solution is also updated. --- Today I will share my personal approach to taking notes on books using [Roam](Today I will share my personal approach to taking notes on books using Roam. ). If you are into sketchnoting or if you are using [Obsidian](https://obsidian.md), I have a new post on the subject of book summaries: [Sketchnoting a Book in Obsidian](https://www.zsolt.blog/2021/07/sketchnoting-book-in-obsidian.html). Thank you, Tiago for all your valuable insights on the effective summarization of books using progressive summarization. This post is based on what I've learned from [Progressive Summarization: A Practical Technique for Designing Discoverable Notes](https://fortelabs.co/blog/progressive-summarization-a-practical-technique-for-designing-discoverable-notes/) and Tiago's video series on the same topic:  1. [How to Decide What to Highlight in eBooks](https://youtu.be/3YO4_O_mqyo) 2. [How to Progressively Summarize a Digital Note](https://youtu.be/fWFKoVbSwGo) 3. [How to Create and Outline with Digital Notes](https://youtu.be/u9xWVuzqt3g) 4. [How to Write a Book Summary](https://youtu.be/AdWyWK2QFRE) My practice has evolved significantly over the past years. Since about 2002, until May this year, I was a devoted [TheBrain](https://www.thebrain.com/) addict. TheBrain lends itself to a slightly different type of note-taking style compared to more document-centric systems. My notes on books, online courses, YouTube, etc. in TheBrain are a mix of mind maps and brief text notes, resulting in a highly visual representation of the key thoughts and learnings from the content, I was consuming.  Since moving to Roam in May and having read Sönke Ahrens's book [How to Take Smart Notes](https://www.amazon.com/How-Take-Smart-Notes-Nonfiction-ebook/dp/B06WVYW33Y), and Tiago's articles on progressive summarization, I have been experimenting with taking more text-heavy notes and creating "proper" book summaries. My current approach is by no means perfect and I am sure that if I write a similar article a year from today, it will have changed considerably. I hope nonetheless that you will be able to take a couple of ideas from my practice and integrate it into your own. # Progressive Summarization Progressive summarization balances compression with maintaining context. The basic idea is to create a document that is short, searchable, and if I pick it up a couple of years from today, it will hold enough context to remind me of the key points I've learned from reading that book. It is the process of taking a full textbook and creating a mini-summary or remix in such a way, that each step of the compression process is simple to execute and can be accomplished in a relatively short amount of time, spread across time, in the course of other work, and only doing as much or as little as the information deserves.  Tiago defines 5 layers of summarization, each layer simple to implement, and requiring limited effort. By building the layers one on top of the other the end result is a powerful compression of the text. The beauty of the approach is that it maintains context throughout the process allowing for later drill down into my literature notes or even the book if required. ![[Untitled.png|]] ## Layer 0 In Roam I create a page for the book under the [[Book]] namespace and create separate pages for the [[Literature Notes]], [[Reflections]] and [[Summary]] each in their own namespaces. I use [[page references]] for the namespaces to improve querying and filtering my notes in Roam. ![[Bookpage.png|]] ## Layer 1 **UPDATE:** Check out my new post on [importing ePub books directly into Roam](https://www.zsolt.blog/2020/12/read-books-in-roam-detailed-how-to.html). I read on a Kindle. My layer 1 notes are text highlights and occasional personal notes next to the highlights. I found Tiago's best practice advice to highlight every chapter title very helpful as this way the resulting kindle highlights maintains the original structure of the book. This provides excellent context when processing the kindle highlights in Roam later. I am very liberal in deciding what I highlight. I typically end up with roughly 5-10% of the book highlighted. Once finished with the book I use a primitive Python script on [colab.research.google.com](https://colab.research.google.com/) to convert the kindle highlights file to an outline that I can import to Roam.    ![[colab.png|]] ```python import re from google.colab import drive drive.mount('/content/gdrive') root = '/content/gdrive/My Drive/' clippings = 'Kindlehighlights.txt' clippings_file = open(root+clippings,'r') kindle_notes = clippings_file.readlines() clippings_file.close() print('%d lines read' % len(kindle_notes)) i = 0 page = 0 for line in kindle_notes: if i % 5 == 1: p2 = re.findall('\d+',line)[0] if page != p2: page = p2 print('loc %s' % page) if i % 5 == 3: print('\t%s' % re.sub('[\n]+','',line)) i += 1 ``` ## Layer 2 Once I've imported my Layer 1 notes into Roam, I read through the notes and use CTRL+Alt 1,2,3 to mark chapter headings. If there are parts, sections, chapters in the book I use headings and indents to structure the text. During this first readthrough I also ^^highlight^^ (CTRL+H) parts of my notes that I find more important. I don't spend too much time deciding what to highlight, I just follow my heart. I typically end up with half or one third of the text highlighted. This typically takes 30 minutes on a 250 page book. ## Layer 3 During my second pass through the literature notes I focus my attention on the highlighted text and mark with bold the key words or fragments that I find particularly important. This is second round of review takes about 20 minutes.  ![[highlight.png|]] Note: The reason for first highlighting and then marking text bold is due to the way Roam interprets markdown. ****bold ^^bold & highlight^^ bold**** does not work in Roam unfortunately. ^^highlight ****highlight & bold**** highlight^^ on the other hand works nicely. I make this note just because Tiago recommends just the opposite, first bold, then highlight. In the end it does not really matter, I am just sharing as an interesting side point. ![[highlights.png|]] ## Layer 4 I write my book summary by reading my highlights in the sidebar and authoring the summary on the [[Summary]]/ page. Thanks to [Roam42](https://www.roam42.com) [SmartBlocks](https://roamresearch.com/#/app/roamhacker/page/GH0401tnt), since today I have a script that I can use to pre-populate the summary page with only my highlights from my literature notes. Once I run the script I go through that text making my edits to finalize the book summary. My SmartBlock reads the clipboard for the title of the page with my literature notes. My process is the following: 1. I open the literature notes in the sidebar 2. I open the [[Summary]]/ page in the main window 3. I create a page link to the page with my literature highlights on the Summary page (e.g. [[[[Literature Notes]]/The Checklist Manifesto]]) 4. I create a nested block under this page link and execute the Smart Block by typing "jjSummary" 5. I am prompted to specify the separator to use between highlights, and also to confirm if I want to remove **bold** highlights as well. 6. Voila, I have all my highlights in my summary including a * reference back to my literature notes, ready to be further processed. ![[extract.png|]] This is how you can install and use Roam42 and my SmartBlock for Progressive Summarization: ### Roam #42Smartblock [https://github.com/roamhacker/SmartBlocks/issues/102](https://github.com/roamhacker/SmartBlocks/issues/102) Download the Roam.json for this block to import into Roam from [here](https://zsviczian.github.io/ProgressiveSummarization.zip). ```markdown - #42SmartBlock Summary - <%JA:```javascript async function print(s,uid) { let reg = new RegExp('\\^\\^(.*?)\\^\\^','g'); let ht = ''; while (match = reg.exec(s)) { ht += (ht=='') ? '' : highlightSeparator; highlight = match[1]; if (removeBold) highlight = highlight.replaceAll('**',''); ht += highlight; } if(ht != '') { ht += ' [*]((('+ uid +')))'; await roam42.smartBlocks.activeWorkflow.outputAdditionalBlock(ht, false); } } async function sortObjectsByOrder(o) { return o.sort(function(a, b) { return a[0].order - b[0].order; }); } async function printChildren(o) { await print(o.string,o.uid); if(o.children) { var b = await roam42.common.getBlockInfoByUID(o.uid,true); var c = await roam42.common.sortObjectsByOrder(b[0][0].children); for(var i=0;i<c.length;i++) await printChildren(c[i]); } } //read source page link from parent block let UID = document.querySelector("textarea.rm-block-input").id; UID = UID.substring( UID.length -9); let blockInfo = await roam42.common.getBlockParentUids(UID); if(blockInfo.length != 1) { alert('Nest command under block containing the [[Page Link]] to your highlighted notes'); return null; } var pageTitle = blockInfo[0][0]['string'].match('\\[{2}(.*)\\]{2}'); if(pageTitle == null) { alert('Can\'t find [[Page Link]] in parent block'); return null; } pageTitle = pageTitle[1]; var highlightSeparator = prompt('Set text for separating highlights within the paragraph\nFor example " " or " ... "',' ... '); var removeBold = prompt('Do you want to remove **bolding** of text?\ni.e. Make **TEXT** into TEXT\n[Y]/[N]','Y'); removeBold = (removeBold=='Y' || removeBold=='y') ? true : false; //query for source page var rule = '[[(ancestor ?b ?a)[?a :block/children ?b]]]'; var query = `[:find (pull ?block [:block/string :block/uid :block/order :block/heading :block/children]) :in $ ?page_title % :where [?page :node/title ?page_title] (ancestor ?block ?page)]`; var results = await window.roamAlphaAPI.q(query, pageTitle, rule); results = await sortObjectsByOrder(results); for (j=0;j<results.length;j++) { await printChildren(results[j][0]); }```%> ``` ## Layer 5 I don't yet have much practice with Layer 5. This is reserved for the most valuable information, when I want to remix the material from the book following my own logic and create an article or a blogpost.