diff --git a/.circleci/config.yml b/.circleci/config.yml index 3bf986cca..13d339892 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,17 +2,23 @@ # # Check https://circleci.com/docs/2.0/language-javascript/ for more details # -version: 2 +version: 2.1 + +orbs: + node: circleci/node@3.0.0 + jobs: build: docker: - - image: circleci/node:16.10.0 - - image: circleci/mongo:4.4 + - image: cimg/node:16.11.0 + - image: mongo:4.4 - working_directory: ~/repo + working_directory: ~/homebrewery + executor: node/default steps: - - checkout + - checkout: + path: ~/homebrewery # Download and cache dependencies - restore_cache: @@ -21,12 +27,48 @@ jobs: # fallback to using the latest cache if no exact match is found - v1-dependencies- - - run: npm install + - node/install-npm + - node/install-packages: + app-dir: ~/homebrewery + cache-path: node_modules + override-ci-command: npm i - save_cache: paths: - node_modules key: v1-dependencies-{{ checksum "package.json" }} + - persist_to_workspace: + root: . + paths: + - . + + test: + docker: + - image: cimg/node:16.11.0 + + working_directory: ~/homebrewery + parallelism: 4 + + steps: + - attach_workspace: + at: . + # run tests! - - run: npm run circleci + - run: + name: Test - Basic + command: npm run test:basic + - run: + name: Test - Mustache Spans + command: npm run test:mustache-span + - run: + name: Test - Routes + command: npm run test:route + +workflows: + build_and_test: + jobs: + - build + - test: + requires: + - build \ No newline at end of file diff --git a/README.md b/README.md index 9a5faeaf4..35f0150d1 100644 --- a/README.md +++ b/README.md @@ -9,37 +9,37 @@ using [Markdown][markdown-url]. It is distributed under the terms of the [MIT Li [markdown-url]: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet ## Quick Start -The easiest way to get started using the Homebrewery is to use it +The easiest way to get started using The Homebrewery is to use it [on our website][homebrewery-url]. The code is open source, so feel free to -clone it, tinker with it. If you want to make changes to the code, you can run +clone it and tinker with it. If you want to make changes to the code, you can run your own local version for testing by following the installation instructions below. [homebrewery-url]: https://homebrewery.naturalcrit.com ### Installation -First, install three programs that the Homebrewery requires to run and retrieve +First, install three programs that The Homebrewery requires to run and retrieve updates: 1. install [node](https://nodejs.org/en/) 1. install [mongodb](https://www.mongodb.com/try/download/community) (Community version) - For easiest installation, follow these steps: - 1. In the installer, uncheck the option to run as a service - 1. You can install MongoDB Compass if you want a GUI to view your database documents - 1. Go to the C drive and create a folder called "data" - 1. Inside the "data" folder, create a new folder called "db" - 1. Open a command prompt or other terminal and navigate to your mongodb install folder (c:program files\mongo\server\4.4\bin) - 1. In the command prompt, run "mongod", which will start up your local database server - 1. While MongoD is running, open a second command prompt and navigate to the mongodb install folder - 1. In the second command prompt, run "mongo", which allows you to edit the database - 1. Type `use homebrewery` to create the homebrewery database. You should see `switched to db homebrewery` - 1. Type `db.brews.insert({"title":"test"})` to create a blank document. You should see `WriteResult({ "nInserted" : 1 })` - 1. Search in Windows for "Advanced system settings" and open it - 1. Click "Environment variables", find the "path" variable, and double-click to open it - 1. Click "New" and paste in the path to the mongodb "bin" folder - 1. Click "OK", "OK", "OK" to close all the windows -1. install [git](https://git-scm.com/downloads) (select the option that allows Git to run from the command prompt) + For the easiest installation, follow these steps: + 1. In the installer, uncheck the option to run as a service. + 1. You can install MongoDB Compass if you want a GUI to view your database documents. + 1. Go to the C:\ drive and create a folder called "data". + 1. Inside the "data" folder, create a new folder called "db". + 1. Open a command prompt or other terminal and navigate to your MongoDB install folder (C:\Program Files\Mongo\Server\4.4\bin). + 1. In the command prompt, run "mongod", which will start up your local database server. + 1. While MongoD is running, open a second command prompt and navigate to the MongoDB install folder. + 1. In the second command prompt, run "mongo", which allows you to edit the database. + 1. Type `use homebrewery` to create The Homebrewery database. You should see `switched to db homebrewery`. + 1. Type `db.brews.insert({"title":"test"})` to create a blank document. You should see `WriteResult({ "nInserted" : 1 })`. + 1. Search in Windows for "Advanced system settings" and open it. + 1. Click "Environment variables", find the "path" variable, and double-click to open it. + 1. Click "New" and paste in the path to the MongoDB "bin" folder. + 1. Click "OK" three times to close all the windows. +1. install [git](https://git-scm.com/downloads) (select the option that allows Git to run from the command prompt). Checkout the repo ([documentation][github-clone-repo-docs-url]): ``` @@ -54,7 +54,7 @@ the project to run locally. You can set this temporarily in your shell of choice: * Windows Powershell: `$env:NODE_ENV="local"` * Windows CMD: `set NODE_ENV=local` -* Linux / OSX: `export NODE_ENV=local` +* Linux / macOS: `export NODE_ENV=local` Third, you will need to install the Node dependencies, compile the app, and run it using the two commands: @@ -63,7 +63,7 @@ it using the two commands: 1. `npm start` You should now be able to go to [http://localhost:8000](http://localhost:8000) -in your browser and use the Homebrewery offline. +in your browser and use The Homebrewery offline. ### Running the application via Docker @@ -95,11 +95,11 @@ You can check out the [changelog](./changelog.md). ## License -This project is licensed under the [MIT license](./license). Which means you +This project is licensed under the [MIT license](./license), which means you are free to use The Homebrewery in any way that you want, except for claiming that you made it yourself. -If you wish to sell or in some way gain profit for what's created on this site, +If you wish to sell, or in some way gain profit for, what's created on this site, it's your responsibility to ensure you have the proper licenses/rights for any images or resources used. @@ -108,13 +108,12 @@ images or resources used. You are welcome to contribute to the development and maintenance of the project! There are several ways of doing that: - At the moment, we have a huge backlog of [issues][repo-issues-url] and some - of them are outdated, duplicates or doesn't contain any useful info. In order - to help you can [mark duplicates][github-mark-duplicate-url], try to - reproduce some complex or weird issues, try with finding a workaround for a - reported bug or just mention issue managers team to let them know about - outdated issue via `@naturalcrit/issue-managers`. + of them are outdated, duplicates, or don't contain any useful info. To help, you can [mark duplicates][github-mark-duplicate-url], try to + reproduce some complex or weird issues, try finding a workaround for a + reported bug, or just mention our issue managers team to let them know about + outdated issues via `@naturalcrit/issue-managers`. - Our [subreddit][subreddit-url] is constantly growing and there are number of - bug reports: any help with sorting them out is very welcome. + bug reports. Any help with sorting them out is very welcome. - And of course you can contribute by fixing a bug or implementing a new feature by yourself, we are waiting for your [pull requests][github-pr-docs-url]! diff --git a/changelog.md b/changelog.md index 1b22c7d8d..c4f5e4420 100644 --- a/changelog.md +++ b/changelog.md @@ -3,11 +3,12 @@ h5 { font-size: .35cm !important; } -.taskList li { - list-style-type : none; +.page ul ul { + margin-left: 0px; } .taskList li input { + list-style-type : none; margin-left : -0.52cm; transform: translateY(.05cm); filter: brightness(1.1) drop-shadow(1px 2px 1px #222); @@ -28,11 +29,162 @@ pre { .page p + pre { margin-top : 0.1cm; } + +.page .openSans { + font-family: 'Open Sans'; + font-size: 0.9em; +} ``` ## changelog For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery). +### Thursday 09/06/2022 - v3.1.1 +{{taskList + +##### Calculuschild: + +* [x] Fixed class table decorations appearing on top of the table in PDF output. + + Fixes issues: [#1784](https://github.com/naturalcrit/homebrewery/issues/1784) + +* [x] Fix bottom decoration on half class tables disappearing when the table is too short. + + Fixes issues: [#2202](https://github.com/naturalcrit/homebrewery/issues/2202) +}} + +### Monday 06/06/2022 - v3.1.0 +{{taskList + +##### G-Ambatte: + +* [x] "Jump to Preview/Editor" buttons added to the divider bar. Easily sync between the editor and preview panels! + + Fixes issues: [#1756](https://github.com/naturalcrit/homebrewery/issues/1756) + +* [x] Speedups to the user page for users with large and/or many brews. + + Fixes issues: [#2147](https://github.com/naturalcrit/homebrewery/issues/2147) + +* [x] Search text on the user page is saved to the URL for easy bookmarking in your browser + + Fixes issues: [#1858](https://github.com/naturalcrit/homebrewery/issues/1858) + +* [x] Added easy login system for offline installs. + + Fixes issues: [#269](https://github.com/naturalcrit/homebrewery/issues/269) + +* [x] New **THUMBNAIL** option in the {{fa,fa-info-circle}} **Properties** menu. This image will show up in social media links. + + Fixes issues: [#820](https://github.com/naturalcrit/homebrewery/issues/820) +}} + +### Wednesday 27/03/2022 - v3.0.8 +{{taskList +* [x] Style updates to user page. + +* [x] Added a logout button (finally)! You can find it under {{openSans **USERNAME {{fa,fa-user}} → LOGOUT {{fas,fa-power-off}}**}} + + Fixes issues: [#303](https://github.com/naturalcrit/homebrewery/issues/303) + +* [x] Clarified the default text when submitting an issue via Reddit post. + +* [x] Fixed broken Table of Contents links in PDFs. (Thanks lucastucious!) + + Fixes issues: [#1749](https://github.com/naturalcrit/homebrewery/issues/1749) + +* [x] Fixed window resizing causing the edit page divider to get lost off of the edge of the page. + + Fixes issues: [#2053](https://github.com/naturalcrit/homebrewery/issues/2053) + +* [x] Fixed Class Table decorations overlapping main text. + + Fixes issues: [#1985](https://github.com/naturalcrit/homebrewery/issues/1985) + +* [x] Updated {{openSans **STYLE EDITOR {{fa,fa-pencil-alt}} → REMOVE DROP CAP {{fas,fa-remove-format}}**}} snippet to also remove small-caps first line font. + +* [x] Background work in preparation for brew themes. +}} + +### Wednesday 02/02/2022 - v3.0.7 +{{taskList +* [x] Revert active line highlighting. + + Fixes issues: [#1913](https://github.com/naturalcrit/homebrewery/issues/1913) + +* [x] Added install steps for Ubuntu. [HERE](https://github.com/naturalcrit/homebrewery/blob/master/install/README.UBUNTU.md) + + Fixes issues: [#1900](https://github.com/naturalcrit/homebrewery/issues/1900) + +* [x] Added social media links to home page. + +* [x] Increase brews visible on the user page to 1,000. + + Fixes issues: [#1943](https://github.com/naturalcrit/homebrewery/issues/1943) + +* [x] Added a Legacy to V3 migration guide under {{openSans **NEED HELP? {{fa,fa-question-circle}} → MIGRATE {{fas,fa-file-import}}**}} + +* [x] Background refactoring and unit tests. +}} + +### Saturday 18/12/2021 - v3.0.6 +{{taskList +* [x] Fixed text wrapping for long strings in code blocks. + + Fixes issues: [#1736](https://github.com/naturalcrit/homebrewery/issues/1736) + +* [x] Code search/replace PC: `CTRL F / CTRL SHIFT F` / Mac: `CMD F / OPTION CMD F` + + Fixes issues: [#1201](https://github.com/naturalcrit/homebrewery/issues/1201) + +* [x] Auto-closing HTML tags and curly braces `{{ }}` +* [x] Highlight current active line + + Fixes issues: [#1202](https://github.com/naturalcrit/homebrewery/issues/1202) + +* [x] Display tabs and trailing spaces + + Fixes issues: [#1622](https://github.com/naturalcrit/homebrewery/issues/1622) + +* [x] Make columns even in V3 Table of Contents. + + Fixes issues: [#1671](https://github.com/naturalcrit/homebrewery/issues/1671) + +* [x] Fix `CTRL P` failing to print from `/new` pages. + + Fixes issues: [#1815](https://github.com/naturalcrit/homebrewery/issues/1815) +}} + +\page + +### Tuesday 07/12/2021 - v3.0.5 +{{taskList +* [x] Fixed paragraph spacing for **note** and **descriptive** boxes in V3. + + Fixes issues: [#1836](https://github.com/naturalcrit/homebrewery/issues/1836) + +* [x] Added a whole bunch of hotkeys: + + * Page Break `CTRL + ENTER` + * Column Break `CTRL + SHIFT + ENTER` + * Bulleted Lists `CTRL + L` + * Numbered Lists `CTRL + SHIFT + L` + * Headers `CTRL + SHIFT + (1-6)` + * Underline `CTRL + U` + * Link `CTRL + K` + * Non-breaking space (\ ) `CTRL + .` + * Add Horizontal Space `CTRL + SHIFT + .` + * Remove Horizontal Space `CTRL + SHIFT + ,` + * Curly Span `CTRL + M` + * Curly Div `CTRL + SHIFT + M` + +* [x] Fixed page numbers in the editor panel getting scrambled when scrolling up and down. + +* [x] Faster swapping between tabs on long brews. + +* [x] Better error messages for common issue with Google Drive credentials expiring. +}} + ### Wednesday 17/11/2021 - v3.0.4 {{taskList * [x] Fixed incorrect sorting of Google brews by page count and views on the user page. @@ -69,6 +221,12 @@ For a full record of development, visit our [Github Page](https://github.com/nat * [x] Added {{fa,fa-undo}} **Undo** and {{fa,fa-redo}} **Redo** buttons to the snippet bar. +}} + +\column + +{{taskList + * [x] Switching between the {{fa,fa-beer}} **Brew** and {{fa,fa-paint-brush}} **Style** tabs no longer loses your scroll position or undo history. Fixes issues: [#1735](https://github.com/naturalcrit/homebrewery/issues/1735) diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index ad767ad9f..787423528 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -17,6 +17,7 @@ const PAGE_HEIGHT = 1056; const PPR_THRESHOLD = 50; const BrewRenderer = createClass({ + displayName : 'BrewRenderer', getDefaultProps : function() { return { text : '', @@ -187,7 +188,7 @@ const BrewRenderer = createClass({ : null} -
+ Sort by :+ |
+ {this.renderSortOption('Title', 'alpha')}
+ {this.renderSortOption('Created Date', 'created')}
+ {this.renderSortOption('Updated Date', 'updated')}
+ {this.renderSortOption('Views', 'views')}
+ {/* {this.renderSortOption('Latest', 'latest')} */}
+
+ Direction :+ |
+ + + | + {this.renderFilterOption()} +
+
+
+
+
+}}
\page
@@ -123,9 +129,7 @@ A blank line can be achieved with a run of one or more `:` alone on a line. More
Much nicer than `