-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add import handling for images in bear notes
This isn't an optimal solution since Bear uploads files/images to their cloud and doesn't preserve any metadata about a (possible) local path to that file on disk. Instead we have to specify some search paths, do a recursive glob, and attempt to locate source files with the proper filenames ourselves.
- Loading branch information
1 parent
4df22b7
commit 6cd9172
Showing
7 changed files
with
213 additions
and
18 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
type Config = { | ||
blogTagPattern: string; | ||
imageSearchPaths: string[]; | ||
defaultLayout: string; | ||
postsPath: string; | ||
assetsUrl: string; | ||
} | ||
|
||
const config: Config = { | ||
blogTagPattern: '^(blog\/solomonhawk\/?)|(blog\/?)', | ||
// XXX: this isn't great - is there a better way to find the images that were | ||
// embedded in a bear post? | ||
imageSearchPaths: [ | ||
"~/Downloads", | ||
"~/Documents", | ||
"~/Pictures", | ||
], | ||
defaultLayout: '@layouts/BlogPost.astro', | ||
postsPath: 'src/pages/writing/posts', | ||
assetsUrl: '/assets/images' | ||
} | ||
|
||
export default config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/pages/writing/posts/is-code-formatting-a-linter-concern.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
layout: '@layouts/BlogPost.astro' | ||
title: Is code formatting a linter concern? | ||
publishDate: 2022-09-26T04:00:00.000Z | ||
tags: [draft, linting, code-quality, formatting, prettier, eslint] | ||
--- | ||
Linters and code-formatters are both crucial tools I rely on for writing quality software. I’m always happy to delegate effort to a tool that can statically analyze my work and provide helpful guidance. | ||
|
||
According to the [wiki](https://en.wikipedia.org/wiki/Lint_(software)), linting encompasses automated checks for programming errors, bugs, stylistic errors and “suspicious constructs”. | ||
|
||
Code-formatters are constrained to consider style and presentation only. The [wiki](https://en.wikipedia.org/wiki/Prettyprint#Programming_code_formatting) entry under `Prettyprint` describes converting source code from one format to another. | ||
|
||
A fair question to ask is how best to integrate tools of these 2 categories. It seems that, to a degree, the category of tools that lint code encompass those that format it. | ||
|
||
![linters-formatters](/assets/images/linters-formatters.png) | ||
|
||
In the JavaScript ecosystem, the standard toolset includes [ESLint](https://eslint.org/) and [Prettier](https://prettier.io/). One notable difference between the two is configurability and extensibility. Prettier is opinionated and has limited customization through its configuration file which is a feature, not a bug. |