diff --git a/Makefile b/Makefile index 1a29f03..574b16d 100644 --- a/Makefile +++ b/Makefile @@ -1,20 +1,28 @@ -SHELL := /bin/bash -FILE := tmp.txt -CAT := bat +SHELL=/bin/bash +COMMAND_COLOR = \033[36m +SELECT_COLOR = \033[34m +DESC_COLOR = \033[32m +CLEAR_COLOR = \033[0m -# ifeq (, $(shell which bat)) -# $(error "No bat in $(PATH), consider installing it") -# CAT = cat -# endif +.PHONY: help +help: ## prints this message ## + @echo ""; \ + echo "Usage: make "; \ + echo ""; \ + echo "where is one of the following:"; \ + echo ""; \ + grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ + perl -nle '/(.*?): ## (.*?) ## (.*$$)/; if ($$3 eq "") { printf ( "$(COMMAND_COLOR)%-20s$(DESC_COLOR)%s$(CLEAR_COLOR)\n\n", $$1, $$2) } else { printf ( "$(COMMAND_COLOR)%-20s$(DESC_COLOR)%s$(CLEAR_COLOR)\n%-20s%s\n\n", $$1, $$2, " ", $$3) }'; - -.PHONY : compile run - -compile : - @ls -1 posts/ | sed -e "s/\..*$$//" | uniq | grep -v 'example'; \ - read -p "Which post? " post; \ - ./node_modules/showdown/bin/showdown.js makehtml -i posts/$$post.md -o posts/$$post.html - -run : +.PHONY: compile +compile: ## convert md files to html ## (uses "showdown.js" in node_modules) + @echo ""; \ + echo "Select Post to Compile:"; \ + echo -e "$(SELECT_COLOR)"; \ + ./select.sh + +.PHONY: run +run: ## npm run startdev ## @echo "-> Running" - @npm run startdev \ No newline at end of file + @npm run startdev + diff --git a/app.js b/app.js index d0874d8..8615e42 100644 --- a/app.js +++ b/app.js @@ -31,7 +31,7 @@ app.get('/posts', (req, res) => { for (let i = 0; i < files.length; i++) { if (path.extname(files[i]) === '.json') { let postData = getData(files[i]) - if (postData) { + if (postData && postData.active === 'posts') { data.posts.push(postData) } else { console.log(files[i], 'does not have a corresponding "html" file') @@ -94,7 +94,14 @@ app.get('/posts/:post', (req, res) => { }) app.get('/bnp/changelog', (req, res) => { - res.sendFile(__dirname + '/posts/bnp-changelog.html') + let postData + try { + postData = JSON.parse(fs.readFileSync('./posts/bnp-changelog.json', 'utf8')) + postData.content = fs.readFileSync('./posts/' + postData.content_file, 'utf8') + } catch (e) { + return res.redirect('/404') + } + return res.render('pages/post', postData) }) const port = 3000 diff --git a/core.css b/core.css index ab1c5d4..e4fce21 100644 --- a/core.css +++ b/core.css @@ -208,10 +208,14 @@ code.prettyprint { color: #999; } +.jBox-image-label.active { + background-color: #3883FA !important; +} + /* Hack Font */ - +/* @font-face { font-family: 'Hack'; src: url('fonts/hack-regular.woff2?sha=e700a30') format('woff2'), url('fonts/hack-regular.woff?sha=e700a30') format('woff'); @@ -239,3 +243,4 @@ code.prettyprint { font-weight: 700; font-style: italic; } +*/ \ No newline at end of file diff --git a/posts/bnp-changelog.html b/posts/bnp-changelog.html index 39836d5..5296902 100644 --- a/posts/bnp-changelog.html +++ b/posts/bnp-changelog.html @@ -1,10 +1,49 @@ -

Better Network Panel - Changelog

+

Better Network Panel - Changelog

+

Version 1.0.0

+

+ Version 1.0.0 Screenshot +

+

+

Improved Search

+

Advanced search capability has been added in this release which improves on the previous search by adding a negation search (i.e. "-carts" which would remove requests containing "carts" in the results).

+

+ New Improved Search Screenshot +

+

Additionally, AND and OR searching filters have been added. So you can search for:

+
+

products AND services

+
+

Which would return any request containing BOTH products AND services somewhere in the headers, request body, etc…

+

And you can search for:

+
+

products OR services

+
+

Which would return any requests containing EITHER products OR services.

+

+

JSON Editor BUILT IN

+

Using the Open Source JSON Editor, you can now easily search and view JSON data just as you can on the official jsoneditoronline.org website.

+

+ JSON Editor Screenshot +

+

+

Vertical Chrome Panel

+

Better Network Panel now supports a vertical layout using responsive CSS. Panel resizing will be released soon.

+

+ Vertical Panel Screenshot +

+

+

Download JSON

+

Download the current panel as a JSON doc.

+

+ Download JSON Button Screenshot +

\ No newline at end of file diff --git a/posts/bnp-changelog.json b/posts/bnp-changelog.json new file mode 100644 index 0000000..ba8d755 --- /dev/null +++ b/posts/bnp-changelog.json @@ -0,0 +1,9 @@ +{ + "title": "Better Network Panel - Changelog - Levi Olson", + "permalink": "/posts/bnp-changelog", + "created_at": "2021-01-23T10:05:19-06:00", + "created_at_short": "2021-01-23", + "post_title": "Better Network Panel - Changelog", + "active": "", + "content_file": "bnp-changelog.html" +} \ No newline at end of file diff --git a/posts/bnp-changelog.md b/posts/bnp-changelog.md new file mode 100644 index 0000000..bb3dc0c --- /dev/null +++ b/posts/bnp-changelog.md @@ -0,0 +1,62 @@ +# Better Network Panel - Changelog + +- [Version 1.0.0](#version-100) + - [Improved Search](#improved-search) + - [JSON Editor BUILT IN](#json-editor-built-in) + - [Vertical Chrome Panel](#vertical-chrome-panel) + - [Download JSON](#download-json) + +## Version 1.0.0 + + + ![Version 1.0.0 Screenshot](/images/v1.0.0-FullScreenshot.png) + + + +### Improved Search + +Advanced search capability has been added in this release which improves on the previous search by adding a negation search (i.e. "-carts" which would remove requests containing "carts" in the results). + + + ![New Improved Search Screenshot](/images/v1.0.0-Search.png) + + + +Additionally, **AND** and **OR** searching filters have been added. So you can search for: + +> `products` **AND** `services` + +Which would return any request containing **BOTH** `products` **AND** `services` somewhere in the headers, request body, etc... + +And you can search for: + +> `products` **OR** `services` + +Which would return any requests containing **EITHER** `products` **OR** `services`. + + +### JSON Editor BUILT IN + +Using the Open Source [JSON Editor](https://github.com/josdejong/jsoneditor), you can now easily search and view JSON data just as you can on the official [jsoneditoronline.org](https://jsoneditoronline.org) website. + + + ![JSON Editor Screenshot](/images/v1.0.0-JSONEditor.png) + + + +### Vertical Chrome Panel + +Better Network Panel now supports a vertical layout using responsive CSS. Panel resizing will be released soon. + + + ![Vertical Panel Screenshot](/images/v1.0.0-VerticalPanel.png) + + + +### Download JSON + +Download the current panel as a JSON doc. + + + ![Download JSON Button Screenshot](/images/v1.0.0-DownloadJSON.png) + diff --git a/posts/chrome-ext-better-network-panel.html b/posts/chrome-ext-better-network-panel.html index 9760981..df13ce4 100644 --- a/posts/chrome-ext-better-network-panel.html +++ b/posts/chrome-ext-better-network-panel.html @@ -11,11 +11,9 @@

BNP for Chrome

I present to you a Better Network Panel. A Chrome extension that adds a new panel, and offers great features like:

diff --git a/posts/chrome-ext-better-network-panel.md b/posts/chrome-ext-better-network-panel.md index a863687..8bf444e 100644 --- a/posts/chrome-ext-better-network-panel.md +++ b/posts/chrome-ext-better-network-panel.md @@ -1,4 +1,4 @@ -# Better Network Panel - a Chrome extension # +# Better Network Panel - a Chrome extension > "As a Salesforce and Vlocity developer, I'm constantly looking for ways to improve my workflow, speed up my debugging, and find answers fast." @@ -18,11 +18,9 @@ And all of the above is done several times a day. I present to you a [Better Network Panel](https://chrome.google.com/webstore/detail/better-network-panel/kknnkgpbclaljhfcknhbebhppmkmoaml). A Chrome extension that adds a new panel, and offers great features like: -* **Full Search** - Entire request is searchable (i.e. headers, postbody, etc...), not just URI -* **JSON Parsing** - Even nested members that contain stringified JSON are parsed +* **Full Search** - Entire request is searchable (i.e. headers, request body, etc...), not just URI +* **JSON Parsing** - Even nested members that contain stringified JSON are parsed to 3 levels deep * **JSON Search** - Incremental searching is available directly in the Preview pane -* **Import HAR** - Import your own HAR file and use this tool for debugging -* **Download HAR** - Export a request as a HAR file and use an external tool for further debugging * **Regex Search** - Powerfull regex searches can be performed on the Preview pane * More to come @@ -30,7 +28,6 @@ I present to you a [Better Network Panel](https://chrome.google.com/webstore/det View it on [GitHub](https://github.com/leothelocust/better-network-chrome-panel) - ## Special Thanks A huge thanks and recognition goes to [Milton Lai](https://github.com/milton-lai/saml-chrome-panel) and his project SAML Chrome Panel. I started from a fork of his project, but later started fresh as there was a lot of SAML specific code that this project doesn't use/need. The UI is nearly identical, but the code underneath has become fairly different at this point. diff --git a/public/images/v1.0.0-DownloadJSON.png b/public/images/v1.0.0-DownloadJSON.png new file mode 100644 index 0000000..a5d9b75 Binary files /dev/null and b/public/images/v1.0.0-DownloadJSON.png differ diff --git a/public/images/v1.0.0-FullScreenshot.png b/public/images/v1.0.0-FullScreenshot.png new file mode 100644 index 0000000..194b62a Binary files /dev/null and b/public/images/v1.0.0-FullScreenshot.png differ diff --git a/public/images/v1.0.0-JSONEditor.png b/public/images/v1.0.0-JSONEditor.png new file mode 100644 index 0000000..f5f51b8 Binary files /dev/null and b/public/images/v1.0.0-JSONEditor.png differ diff --git a/public/images/v1.0.0-Search.png b/public/images/v1.0.0-Search.png new file mode 100644 index 0000000..9fa9812 Binary files /dev/null and b/public/images/v1.0.0-Search.png differ diff --git a/public/images/v1.0.0-VerticalPanel.png b/public/images/v1.0.0-VerticalPanel.png new file mode 100644 index 0000000..f50b8a7 Binary files /dev/null and b/public/images/v1.0.0-VerticalPanel.png differ diff --git a/select.sh b/select.sh new file mode 100755 index 0000000..db6ac0e --- /dev/null +++ b/select.sh @@ -0,0 +1,14 @@ +#! /usr/bin/env bash + +PS3="Enter a number: " + +OPTIONS=$(ls -1 posts/ | sed -e "s/\..*$//" | uniq | grep -v 'example') +select post in $OPTIONS +do + echo -e "\033[32m" + echo "Compiling: $post.html" + echo -e "\033[33m" + ./node_modules/showdown/bin/showdown.js makehtml -i posts/$post.md -o posts/$post.html + echo -e "\033[0m" + exit 0 +done \ No newline at end of file diff --git a/views/partials/footer.ejs b/views/partials/footer.ejs index 89963ce..f57abc1 100644 --- a/views/partials/footer.ejs +++ b/views/partials/footer.ejs @@ -1,3 +1,10 @@ +