TwoMargins: collaborative financial-document analysis project preview
Back to Selected Work
Development

TwoMargins: collaborative financial-document analysis

We built TwoMargins' SEC document parser and collaborative annotation platform. Bloomberg used it for Warren Buffett's 2015 shareholder letter, and the Wall Street Journal covered the product.

Ruby On RailsPostgreSQLNokogiri
Engagement
Client engagement · Document parsing
Stack
Ruby On Rails · PostgreSQL · Nokogiri

Project reference

The coolest, most constructive best-yet crowdsourcing effort to hit Wall Street

-- Wall Street Journal

Historical work

TwoMargins let analysts, investors and researchers annotate and discuss SEC filings and other financial documents together. This is historical engineering work; current availability is not implied. Its public record includes Wall Street Journal coverage and Bloomberg's archived use of the annotation layer.

Bloomberg and the Buffett letter

Bloomberg used TwoMargins for its annotated interactive edition of Warren Buffett's 2015 annual letter to Berkshire Hathaway shareholders. Luke Kawa at Bloomberg Business wrote the annotations. Readers could highlight passages and add their own commentary through TwoMargins' annotation layer.

The document-processing pipeline converted the letter into annotatable HTML while preserving its financial tables and reading structure. It was one of the platform's highest-profile public uses.

Parsing the documents

SEC filings contain deeply nested HTML and formatting that varies by company, filing type and period. We built a Nokogiri parser that preserved the structure and formatting needed to anchor annotations to passages. It had to handle documents from a few pages to hundreds of pages and make new filings available quickly for time-sensitive releases.

The Buffett letter was a 30-page PDF converted by BCL easyConverter SDK into HTML with 30 page divs. Each contained nested content blocks, financial tables and positional CSS. Our parser normalized that structure for the real-time annotation engine without breaking the formatting of the tables.

Ingestion and annotation

The automated pipeline detected and downloaded new filings from the SEC's EDGAR (Electronic Data Gathering, Analysis, and Retrieval) system, parsed them and made them available with minimal delay. It also handled arbitrary HTML from user-uploaded documents such as the Buffett letter.

We used Annotator.js with a custom Store plugin to map selected text to document positions. A Rails JSON API persisted annotations, comments and analysis. The interface displayed highlighted passages and annotation counts, with threaded replies for discussions.

Multiple users could annotate a document and respond to one another. Twitter, Google and StockTwits authentication made it easier to participate, while guest posting allowed anonymous contributions.

The annotation interface supported oEmbed and iframely for embedding in third-party sites. Bloomberg used that layer, and its article linked directly to the annotated document hosted by TwoMargins.

Supporting the live product

We maintained the hosted platform and supported the team through traffic peaks around earnings reports, regulatory filings during U.S. presidential elections and other market-moving releases. Bloomberg's Buffett article was one of those peaks; the platform stayed responsive as activity rose.

A community of financial analysts and investors used TwoMargins to analyze public-market documents together. The Wall Street Journal featured it, and Bloomberg chose it for the annotated Buffett letter.

Our role

We handled the full technical build: document parsing, annotation, collaboration, server infrastructure and deployment. As the project grew, we onboarded and trained developers so the team could continue without depending on us for every change.

Next project: Roomsie

View all selected work