How evolus/pencil works
Pencil is an Electron-based GUI prototyping and mockup application. Its user workflow is to create or open a design, edit pages and shapes, then save or export the result. The README highlights zip-based documents, tree-structured pages, embedded fonts, and printing/PDF export. The sampled entry point shows startup of background rendering, printing, and shortcut services; most editor and document-stage connections are inferred from documented capabilities, so those links are marked unverified.
Main entry points: ApplicationPane.js Design workspace · index.js Electron entry · document.js Document model · renderer.js Background renderer
Components 19
Application runtime
- Electron entry
app/index.js - App updater
app/updater.js - Shortcut service
app/tools/global-shortcut-main.js - macOS menu
app/views/toolbars/MacOSToolbar.js
Design workspace
- Design workspace
app/views/ApplicationPane.js - Canvas and shapes
app/pencil-core/target - Page management
app/views/common/PageListView.js - Shape properties
app/pencil-core/editor
Documents and assets
- Document model
app/pencil-core/document/document.js - Document file I/O
app/pencil-core/common/FileHandler.js - Shape collections
app/pencil-core/definition/collectionManager.js - Private collections
app/pencil-core/privateCollection/privateCollectionManager.js - Font support
app/pencil-core/common/FontLoader.js
Rendering and output
- Background renderer
app/pencil-core/common/renderer.js - Task queue
app/pencil-core/common/QueueHandler.js - Font utilities
app/pencil-core/common/shared-util.js - Document export
app/pencil-core/exporter/documentExportManager.js - Print and PDF
app/pencil-core/common/webPrinter.js
Other components
- Designer
Connections 20
- Designer → Electron entry: launches
app/index.js - Electron entry → Background renderer: starts
app/index.js - Electron entry → Print and PDF: starts
app/index.js - Electron entry → Shortcut service: starts
app/index.js - Electron entry → macOS menu: creates on macOS
app/index.js - Background renderer → Task queue: queues render tasks
app/pencil-core/common/renderer.js - Background renderer → Font utilities: builds font CSS
app/pencil-core/common/renderer.js - Print and PDF → Task queue: queues print tasks
app/pencil-core/common/webPrinter.js - Designer → Design workspace: edits designs
- Design workspace → Canvas and shapes: edits shapes
- Design workspace → Page management: manages pages
- Design workspace → Shape properties: adjusts properties
- Design workspace → Document model: works with document
- Document model → Document file I/O: saves and opens
- Design workspace → Shape collections: uses shape collections
- Design workspace → Private collections: uses private shapes
- Document model → Font support: embeds custom fonts
- Design workspace → Background renderer: requests rendering
- Document model → Document export: exports document
- Document export → Print and PDF: prints or creates PDF