imported client release

This commit is contained in:
Charles N Wyble 2024-12-15 09:21:45 -06:00
parent d7244f8c6a
commit f6b34690f1
212 changed files with 11652 additions and 2 deletions

10
.gitignore vendored Normal file
View File

@ -0,0 +1,10 @@
local/build-output/JSONResume/*.json
local/build-output/MarkdownResume/*/*.doc
local/build-output/MarkdownResume/*/*.md
local/build-output/MarkdownResume/*/*.pdf
local/build-temp/MarkdownResume/*.yml
local/build-temp/MarkdownResume/*.md
local/build-temp/MarkdownResume/*/*.md
local/build-temp/MarkdownResume/*/*.pdf
local/build-temp/MarkdownResume/*/*.doc

View File

@ -219,7 +219,7 @@ If you develop a new program, and you want it to be of the greatest possible use
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
ReachableCEOConsultantResume
MarkdownResume-Pipeline-ClientExample
Copyright (C) 2024 reachableceo
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

View File

@ -1,2 +1,23 @@
# ReachableCEOConsultantResume
# MarkdownResume-Pipeline-ClientExample
Example client repository for using the [MarkdownResume-Pipeline](https://git.knownelement.com/reachableceo/MarkdownResume-Pipeline) resume building
microservice. The microservice is vendored into this repository.
## Quickstart
### Runtime Requirements
- Bash (this entire project was developed on msys2 on Windows 10)
- Ensure you have pandoc installed and in your path.
### Steps
- Edit local/build/CandidateVariables.env to refelct your information.
- Edit local/Templates/MarkdownResume/WorkHistory/WorkHistory.csv
- Create and edit local/Templates/MarkdownResume/JobHistoryDetails/<position>.md to match the value in the first field of WorkHistory.csv
- Repeat as necessary for your job history.
- Edit local/Templates/MarkdownResume/SkillsAndProjects/Projects.md
- Edit local/Template/MarkdownResume/SkillsAndProjects/Skills.csv
- Edit local/Templates/MarkdownResume/CandidateInfoSheet.md
- cd to the local/build directory and run bash build-demo-markdown.sh
- Examine the PDF/MSWord output in local/build-output/*

View File

@ -0,0 +1,3 @@
# CSV File: awards.csv
# Columns: title,awarder,date,summary
Defender of the Internet,Fight For The Future,2014-10-02,"For my work against mass surveillance and building out civic tools for digital democracy."
Can't render this file because it has a wrong number of fields in line 2.

View File

@ -0,0 +1,3 @@
# CSV File: certificates.csv
# Columns: name,date,issuer,url
Certified Kubernetes Administrator,2021-05-01,Cloud Native Computing Foundation,http://certificates.com/kubernetes
1 # CSV File: certificates.csv
2 # Columns: name,date,issuer,url
3 Certified Kubernetes Administrator,2021-05-01,Cloud Native Computing Foundation,http://certificates.com/kubernetes

View File

@ -0,0 +1,3 @@
institution,url,area,studyType,startDate,endDate,score,courses
"The University of Queensland",,"Software Engineering (incomplete)","Bachelors","2008-02-12","2009-12-12",,
"University of Technology","http://universityoftechnology.com","Computer Science","Bachelor","2010-09-01","2014-06-30","3.8 GPA","CS101 - Introduction to Computer Science; CS201 - Data Structures and Algorithms; CS301 - Operating Systems"
1 institution url area studyType startDate endDate score courses
2 The University of Queensland Software Engineering (incomplete) Bachelors 2008-02-12 2009-12-12
3 University of Technology http://universityoftechnology.com Computer Science Bachelor 2010-09-01 2014-06-30 3.8 GPA CS101 - Introduction to Computer Science; CS201 - Data Structures and Algorithms; CS301 - Operating Systems

View File

@ -0,0 +1,6 @@
# CSV File: interests.csv
# Columns: name,keywords
Gardening,"Lazy Gardening"
Music,"Guitar;Singing;Dancing"
Books,"Reading;Writing;History"
Open Source,"All of it"
Can't render this file because it has a wrong number of fields in line 2.

View File

@ -0,0 +1,3 @@
# CSV File: languages.csv
# Columns: language,fluency
English,Native speaker
1 # CSV File: languages.csv
2 # Columns: language,fluency
3 English,Native speaker

View File

@ -0,0 +1,5 @@
# CSV File: profiles.csv
# Columns: username,url,network
ajaxdavis,https://twitter.com/ajaxdavis,twitter
thomasdavis,https://github.com/thomasdavis,github
1 # CSV File: profiles.csv
2 # Columns: username,url,network
3 ajaxdavis,https://twitter.com/ajaxdavis,twitter
4 thomasdavis,https://github.com/thomasdavis,github

View File

@ -0,0 +1,3 @@
# CSV File: publications.csv
# Columns: name,publisher,releaseDate,url,summary
Advanced JavaScript Techniques,Tech Books Publishing,2019-08-01,http://techbookspublishing.com/advanced-javascript,"A comprehensive guide to modern JavaScript development."
Can't render this file because it has a wrong number of fields in line 2.

View File

@ -0,0 +1,6 @@
# CSV File: references.csv
# Columns: reference,name
"Thomas was hired as a lead developer and, upon the leaving of our co-founder took over as CTO of Earbits. Thomas is, hands down, one of those A Players you hear of companies dying to hire. He is incredibly smart, not just at code but about everything from classical music to Chinese language and culture. Thomas is great to work with and, as a well established contributor to open source projects and several successful ventures, commands the respect of engineers at all levels. I would suggest doing anything you can to have him on your team.","Joey Flores, Co-founder and CEO of Earbits, Inc."
"I've had the great pleasure of working with Thomas for the past three years at Earbits, and on a few side projects. Two years ago our CTO left on a moment's notice, Thomas saved our company by quickly stepping up to fill this role. He has been with our company through thick and thin and made serious personal sacrifices in order to help the company during tough times. He is a phenomenal hacker and a true team player. Highly recommended!","Yotam Rosenbaum, SVP of Operations, Earbits, Inc."
"Thomas is an extremely talented engineer with a very broad range of skills and experience. From being a thought leader in the front-end community via backbonetutorials.com and cdnjs.com, to designing and implementing the API for cdnjs.com, working with Thomas has been fantastic learning experience. Thomas is truly a full stack develop, and his work output is incredible. If there is any opportunity to work with Thomas, I take it. He is the definition of an A player.","Ryan Kirkman, Senior Software Engineer at Nerdwallet"
"On Thomas Davis... Hire this guy. Do not be fooled. Incredibly capable and fast. Plays well with others. Unbelievable at front-end work end programming but that is just the start. Visionary. Hire him before I do.","Greg Davis"
Can't render this file because it has a wrong number of fields in line 2.

View File

@ -0,0 +1,5 @@
# CSV File: skills.csv
# Columns: name,level,keywords
Frontend,Senior,"HTML / JSX;SCSS / CSS / BEM / Styled Components;Javascript / Typescript;React / Next;Redux / Apollo"
Backend,Senior,"Node;Ruby;Python;Postgres;Redis;Serverless"
Devops,Senior,"AWS;G Cloud;Heroku;Caching"
Can't render this file because it has a wrong number of fields in line 2.

View File

@ -0,0 +1,5 @@
# CSV File: volunteer.csv
# Columns: organization,position,url,startDate,summary,highlights
Open Source Project,Contributor,http://opensourceproject.com,2016-01-01,"Contributing to open source projects to improve software quality.","Fixed critical bugs and added new features.;Mentored new contributors."
add_vo
Can't render this file because it has a wrong number of fields in line 2.

View File

@ -0,0 +1,13 @@
# CSV File: work.csv
# Columns: name,position,location,website,startDate,endDate,summary,highlights
Misc Companies,Product Engineer,Melbourne,https://lordajax.com/,2020-05-05,,"Over the past several years, I've worked at various roles and companies. Mostly early stage startups, doing full stack product development.","React / Next;Node / Laravel;LLM's;Diagrams / Canvas"
Tokenized,Senior Javascript Developer,Melbourne,https://tokenized.com/,2020-05-05,2021-05-05,"Tokenized is a Bitcoin wallet for issuing, managing and trading digital tokens. I built out the front end which was packaged as an electron app. It was a difficult frontend to build because we store the users keys locally and used them to sign transactions and contracts.","React;Redux;SCSS;Product"
Blockbid,Senior Javascript Developer,Melbourne,https://platform.blockbid.io,2018-03-01,2020-01-01,"Blockbid is an Australian crypto currency exchange. I started off on the frontend but eventually became lead tech and worked on every moving piece of the exchange. I really enjoyed working with liquidity providers and connecting their platforms to help us achieve liquid markets.","React, Apollo, Styled Components;Node.js / Rails;Docker / Heroku / GCP;Used Figma for design and UX work;Optimizing markets with tens of millions of rows using SQL."
Listium,Developer,,https://listium.com,2016-01-01,2018-01-01,"Built a very large and complex React / Redux application. It works on all platforms and has IOS/Android builds due to it being a PWA. (wrapped it in React Native though only implementing a WebView)","Worked with Postgres, Redis and Dynamodb for storage.;Hosted on a mixture of Heroku Apps and EC2 servers.;Caching by Fastly and Cloudflare;Hybrid app supported on all platforms"
Electronic Frontier Foundation,Developer,,http://www.eff.org,2014-04-01,2016-01-01,"Hired to take EFF's campaigning to the next level by building an action centre in Ruby on Rails. The action centre is built around some large open source tools that lower the barrier to entry when contacting congress.","Developed new tools for contacting congress;Brainstormed campaign ideas to raise maximum awareness about issues;Lots of social networking integration"
Earbits,CTO,,http://www.earbits.com,2013-03-08,2015-01-09,"Started off as a front end developer but took on the role of CTO in early 2013. The application frontend is built with Javascript and organized as a single page application that talks to a collection of Rails web servers which are connected to MongoDB.","Managed a small team of developers and designers;Built the entire frontend application with Backbone.js;Transferred all of the infrastructure from Heroku to AWS"
JSON Resume,Founder,,http://jsonresume.org,2014-04-01,,"JSON Resume is a community driven open source initiative to create a JSON based standard for resumes. There is no reason why there can't be a common standard for writing a resume that can be extended with an ecosystem of open source tools.","This resume is built with JSON Resume;Over 3000 stars on Github;Community developed themes;Tens of thousands of users"
Taskforce.is,Developer,,http://www.taskforce.is,2013-06-01,2016-01-01,"Worked on many politically charged campaigns against mass surveillance. Not only technically challenging work but also a lot of networking and getting my hands dirty with politics. Our biggest project was \"TheDayWeFightBack\"..","Generated 37,000,000 banner views;100, 000 phone calls to congress;500, 000 emails;250, 000 signatures"
Drone Hire,Co-Founder,,http://www.dronehire.org,2013-01-01,,"An international directory of civilian drone / UAV operators for hire. Services include aerial photography, aerial video, mapping, surveying, precision agriculture, real estate photography, remote inspections and infrared imaging. Our plan is to be the place to go when looking for UAV/Drone services. The website is built in Backbone.js and API is built with Node.js and Postgres.","The site and blog combined have managed to receive over 200,000 visitors in 2014."
BackboneTutorials.com,Founder,,http://backbonetutorials.com,2011-01-01,2014-01-01,"I write tutorials and blog post regarding the popular Javascript framework Backbone.js. The tutorials cover a range of topics regarding front end development aimed at beginners, experts and anyone in between.","Over two million unique visitors a year;25,000+ ebook downloads;300,000+ Youtube views"
Ephox,Front-end Developer,,http://ephox.com,2011-01-01,2012-06-01,"Ephox is a worldwide company who is heavily involved with the development of TinyMce and enterprise editors. My primary role included building front-end widgets and applications. Worked on a major product using Backbone.js as a base. Heavily involved in UI/UX design and wire-framing. Also spend a lot of time designing API specifications and documentation.",
Can't render this file because it has a wrong number of fields in line 2.

View File

@ -0,0 +1,121 @@
# {{CandidateName}} Candidate Information Sheet
## Introduction
Hello,
I apologize for the form letter response.
I receive a high volume of recruiter emails every day and I've found this letter to be the most efficient way to
handle the high volume of emails and reduce back and forth emails/texts/calls.
If you have any questions/comments/concerns not covered by this document, please let me know via e-mail and I'm happy to address them!
If you ask me something answered in this document, I will not respond and will not move forward with the opportunity, so please read it in detail!
## Re: share my ID over email
I WILL NOT share my (full or redacted) photo ID over email or any other electronic written
communication. If that is "required" then I have no interest in moving forward with this opportunity.
I am happy to get on a teams/zoom/google meet etc call and show my ID.
## Re: professional references
I am happy to provide professional references once an interview with the end client/customer/hiring manager/team has been scheduled. I will NOT provide references up front. If that is "required" then I have no interest in moving forward with this opportunity.
## Re: relocation
if the role is not based in **{{CandidateLocation}}** or **Other Location** I will need to re-locate
| Question | Answer |
|-------------------------------------------|--------|
| Am I open to relocation? | Yes |
| Am I willing to re-locate at own expense? | No |
| Am I open to up to 100% travel | Yes |
Please be aware that:
- I will **only re-locate at the employer expense**.
- I will need **two weeks of time** to re-locate.
- The net amount of the re-location benefit **MUST be at least {{CandidateRelocationNetMinimumAmount}}** to fully compensate me for the time/effort to re-locate.
- The full re-location benefit **must be provided prior to the confirmed start date**.
- I **will NOT** accept a reimbursement based re-location package.
- I am happy to come onsite (at client expense (paid up front)) for training/orientation etc.
\pagebreak
## Rate Schedule (compensation expectations)
### Fully remote roles
I have a **very strong** preference for fully remote roles.
I am open to (at the absolute bottom of my range):
- **{{CandidateRateSheetRemoteW2HourlyMinimum}}** per hour(w2)
- **{{CandidateRateSheetRemoteW2AnnualMinimum}}** annually
- **{{CandidateRateSheetRemote1099HourlyMinimum}}** per hour (1099/corp to corp)
I have a strong preference for roles that are :
- **{{CandidateRateSheetRemoteW2HourlyPrefer}}** per hour(w2) or more
- **{{CandidateRateSheetRemoteW2AnnualPrefer}}** annually or more
- **{{CandidateRateSheetRemote1099HourlyPrefer}}** per hour (1099/corp to corp) or more
### On-site/hybrid roles
- **{{CandidateRateSheetRemoteW2HourlyPrefer}}** per hour(w2) or more
- **{{CandidateRateSheetRemoteW2AnnualPrefer}}** annually or more
- **{{CandidateRateSheetRemote1099HourlyPrefer}}** per hour (1099/corp to corp) or more
In regards to compensation type, I am open to:
- w2
- corp to corp (I have my own LLC)
- 1099
If you have a rate for any of the compensation options above, send them all. I will pick which one works best for my situation and the opportunity.
If it's a different rate with/without benefits, send both.
If the above is in alignment with this opportunity, please feel free to send me an RTR with the best rate you can offer.
\pagebreak
## Details needed for submission
### My resume
[Download Candidate resume(format)](https://some.resume.somewhere/some-Resume.pdf)
I am happy to discuss and make edits to the resume content specific to the opportunity if you feel they are needed.
### Candidate details
Here are my complete candidate details for submission to the role.
| Question | Answer |
|---------------------------------------|-------------------------------------|
| Full name | {{CandidateName}} |
| E-mail address | {{CandiateEmail}} |
| Phone number | {{CandidatePhone}} |
| Preferred form of contact | {{CandidatePreferredContactMethod}} |
| Work authorization | {{CandidateWorkAuthorization}} |
| Are you employed presently? | {{CandidateEmploymentStatus}} |
| Current location | {{CandidateCurrentLocation}} |
| Current timezone | {{CandidateCurrentTimezone}} |
| Timezones I can work in | {{CandidateWorkableTimezones}} |
| Availability to interview | {{CandidateInterviewAvailability}} |
| Availability to start | {{CandidateStartAvailability}} |
| Highest Education | {{CandidateHighestEducation}} |
| Graduated Year | {{CandidateGraduationYear}} |
| Name of school | {{CandidateSchoolName}} |
| Location of school | {{CandidateSchoolLocation}} |
| Linkedin Profile | ({{CandidateLinkedin}}) |
| Github Profile | ({{CandidateGithub}}) |
| Last project | {{CandidateLastProject}} |
| DOB | {{CandidateDOB}} |
| Total IT/career experience | {{CandidateTotalExperience}} |
| Open to in-office/hybrid/remote | Yes |
| Any trips planned in next six months? | No |

View File

@ -0,0 +1,4 @@
{{CandidateName}}
=====
{{CandidateOneLinerSummary}}

View File

@ -0,0 +1,6 @@
{{CandidateName}}
=====
{{CandidateOneLinerSummary}}
[ [Github Profile]({{CandidateGithub}}) ] . [ [Linkedin Profile]({{CandidateLinkedin}}) ] . [ {{CandidateEmail}} ] . [ {{CandidatePhone}} ] . [ {{CandidateLocation}} ]

View File

@ -0,0 +1,3 @@
- Stuff
- Things
- Amazing project!

View File

@ -0,0 +1,3 @@
- Stuff
- Things
- Amazing project!

View File

@ -0,0 +1,2 @@
- Cool project 1.
- cool project 2.

View File

@ -0,0 +1,2 @@
skill1|1 years|skill,1,details,and,stuff
skill2|2 years|skill2,2,details,and,stuff,and,things
1 skill1 1 years skill,1,details,and,stuff
2 skill2 2 years skill2,2,details,and,stuff,and,things

View File

@ -0,0 +1,2 @@
job1,Title of job 1,January 1 1970 - January 6 1980
job2,Title of Job 2,January 1 1970 - January 6 1980
1 job1 Title of job 1 January 1 1970 - January 6 1980
2 job2 Title of Job 2 January 1 1970 - January 6 1980

View File

@ -0,0 +1 @@
ignore

View File

@ -0,0 +1 @@
ignore

View File

@ -0,0 +1 @@
ignore

View File

@ -0,0 +1 @@
ignore

View File

@ -0,0 +1 @@
ignore

View File

@ -0,0 +1 @@
ignore

View File

@ -0,0 +1,14 @@
title: "{{CandidateName}} Candidate Information Sheet"
titlepage: true
titlepage-logo: "{{CandidateLogo}}"
toc: true
toc-own-page: true
date: \today
header-left: "\\hspace{1cm}"
header-center: "\\leftmark"
header-right: "Page \\thepage"
footer-left: "{{CandidateName}}"
footer-center: "{{CandidateTagline}}"
footer-right: "[Source code]({{SourceCode}})"
urlcolor: {{URLCOLOR}}
page-background: "{{PAGEBACKGROUND}}"

View File

@ -0,0 +1,7 @@
title: "{{CandidateName}} Resume"
header-left: "\\hspace{1cm}"
header-center: "\\leftmark"
header-right: "Page \\thepage"
footer-left: "{{CandidateName}}"
urlcolor: {{URLCOLOR}}
page-background: "{{PAGEBACKGROUND}}"

View File

@ -0,0 +1,12 @@
title: "{{CandidateName}} Resume"
titlepage: true
titlepage-logo: "{{CandidateLogo}}"
date: \today
header-left: "\\hspace{1cm}"
header-center: "\\leftmark"
header-right: "Page \\thepage"
footer-left: "{{CandidateName}}"
footer-center: "{{CandidateTagline}}"
footer-right: "[Source code]({{SourceCode}})"
urlcolor: {{URLCOLOR}}
page-background: "{{PAGEBACKGROUND}}"

View File

@ -0,0 +1,102 @@
###################################################
# Modify these values to suit
###################################################
#############################################################################
#SET THIS NEXT VARIABLE OR NOTHING WILL WORK!!!!
export PipelineClientWorkingDir="D:/tsys/@ReachableCEO/MarkdownResume-Pipeline-ClientExample/local"
#SET THE PREVIOUS VARIABLE OR NOTHING WILL WORK!!!!
#############################################################################
########################
# Contact info
########################
export CandidateName="First Middle Last"
export CandidatePhone="1 123 456 7890"
export CandidateRole="Jack of all trades"
export CandidateLocation="Place 1/Place 2"
export CandidateCity="City"
export CandidateCountry="Country"
export CandidateZipCode="Zip"
export CandidateSkypeID="SkypeID"
export CandidateEmail="candidate@domain.com"
export CandidateAvatar="URLTOAVATAR"
export CandidateWebsite="URLTOCANDIDATEWEbSITE"
########################
# Profile information
########################
export CandidateTagline="Your.Tagline.Here."
export CandidateOneLineSummary="Super awesome and stuff."
export CandidateLinkedin="https://www.linkedin.com/in/ab1"
export CandidateGithubUsername="ghuser"
export CandidateTwitterUsername="twxuser"
##########################################
# Layout/title page /formatting options
##########################################
export CandidateLogo=""
export SourceCode="https://git.knownelement.com/reachableceo/MarkdownResume-Pipeline"
export URLCOLOR="blue"
export PAGEBACKGROUND="./background3.pdf"
export JSONRESUME_THEME="professional"
export PANDOC_TEMPLATE="eisvogel"
###########################
# Yaml files used by pandoc
###########################
export YamlInputTemplateFileCandidateInfoSheet="$PipelineClientWorkingDir/build/BuildTemplate-CandidateInfoSheet.yml"
export YamlInputTemplateFileJobBoard="$PipelineClientWorkingDir/build/BuildTemplate-JobBoard.yml"
export YamlInputTemplateFileClientSubmission="$PipelineClientWorkingDir/build/BuildTemplate-ClientSubmission.yml"
export WordOutputReferenceDoc="$PipelineClientWorkingDir/build/resume-docx-reference.docx"
##########################
# Candidate info sheet
##########################
export CandidatePreferredContactMethod="Email will get the fastest response."
export CandidateWorkAuthorization="US Citizen"
export CandidateEmploymentStatus="Not currently employed"
export CandidateCurrentLocation="City,State,Country etc"
export CandidateCurrentTimezone="Timezone"
export CandidateWorkableTimezones="Timezones"
export CandidateInterviewAvailability="Sometime"
export CandidateStartAvailability="Sometime"
export CandidateHighestEducation="Some education level"
export CandidateGraduationYear="Graduation year"
export CandidateSchoolName="School name"
export CandidateSchoolLocation="School location"
export CandidateLastProject="Last project"
export CandidateDOB="MM/DD"
export CandidateTotalExperience="epoch"
########################
#Compensation targets
########################
export CandidateRelocationNetMinimumAmount="1,987.11"
export CandidateRateSheetRemoteW2HourlyMinimum="\$12.34"
export CandidateRateSheetRemoteW2AnnualMinimum="\$123,456.00"
export CandidateRateSheetRemote1099HourlyMinimum="\$56.78"
export CandidateRateSheetRemoteW2HourlyPrefer="\$34.56"
export CandidateRateSheetRemoteW2AnnualPrefer="\$321,987.00"
export CandidateRateSheetRemote1099HourlyPrefer="\$78.90"
# Other resume data
# Awards
# Interests
# College/University education
# Certifactes
# Please see:
# the CSV files in ../Templates/JSONResume
# the CSV files in ../Templates/MarkdownResume

BIN
local/build/background3.pdf Normal file

Binary file not shown.

View File

@ -0,0 +1,37 @@
#!/usr/bin/env bash
# This is a demo script for the MarkdownResumePipeline server
# This script creates PDF/MSWord output from markdown/csv input
############################################
#Edit this file to reflect your information
############################################
source "./CandidateVariables.env"
####################################################
####################################################
####################################################
#DO NOT CHANGE ANYTHING BELOW THIS LINE
####################################################
####################################################
####################################################
######################################################################################
# Setup key variables that will be used by the build-pipeline-server-markdown.sh script
######################################################################################
export BUILD_OUTPUT_DIR="$PipelineClientWorkingDir/build-output/JSONResume"
export JSON_TEMPLATE_DIRECTORY="$PipelineClientWorkingDir/Templates/JSONResume"
export JobBoardJSONOutputFile="$BUILD_OUTPUT_DIR/job-board/Candidate-Resume.json"
export ClientSubmissionJSONOutputFile="$BUILD_OUTPUT_DIR/client-submit/Candidate-Resume.json"
echo "Cleaning up from previous runs..."
rm $JobBoardJSONOutputFile
rm $ClientSubmissionJSONOutputFile
bash ../../vendor/git.knownelement.com/reachableceo/MarkdownResume-Pipeline/build/build-pipeline-server-json.sh

Binary file not shown.

View File

@ -0,0 +1,168 @@
parserOptions:
ecmaVersion: latest
sourceType: module
env:
es6: true
jasmine: true
node: true
extends: eslint:recommended
rules:
accessor-pairs: error
array-bracket-spacing:
- error
- never
array-callback-return: error
block-spacing:
- error
- never
brace-style: error
comma-dangle: error
comma-spacing: error
comma-style: error
complexity:
- error
- 10
computed-property-spacing: error
consistent-return: error
consistent-this: error
constructor-super: error
curly: error
default-case: error
dot-notation: error
eol-last: error
eqeqeq: error
generator-star-spacing: error
global-require: off
guard-for-in: error
jsx-quotes: error
key-spacing: error
keyword-spacing: error
linebreak-style: error
lines-around-comment:
- error
-
allowBlockStart: true
allowObjectStart: true
allowArrayStart: true
max-statements-per-line: error
new-cap: error
new-parens: error
no-array-constructor: error
no-bitwise: error
no-caller: error
no-case-declarations: error
no-catch-shadow: error
no-class-assign: error
no-cond-assign: error
no-confusing-arrow: error
no-console: off
no-const-assign: error
no-constant-condition: error
no-continue: error
no-delete-var: error
no-dupe-args: error
no-dupe-class-members: error
no-dupe-keys: error
no-duplicate-case: error
no-duplicate-imports: error
no-empty: off
no-empty-character-class: error
no-empty-pattern: error
no-eq-null: error
no-eval: error
no-extend-native: error
no-extra-bind: error
no-extra-boolean-cast: error
no-extra-label: error
no-extra-semi: error
no-fallthrough: error
no-func-assign: error
no-implied-eval: error
no-inner-declarations: error
no-invalid-this: error
no-invalid-regexp: error
no-irregular-whitespace: error
no-iterator: error
no-label-var: error
no-labels: error
no-lone-blocks: error
no-lonely-if: error
no-loop-func: error
no-mixed-spaces-and-tabs: error
no-multi-spaces: error
no-multi-str: error
no-multiple-empty-lines:
- error
-
max: 2
no-native-reassign: error
no-negated-condition: error
no-nested-ternary: error
no-new: error
no-new-func: error
no-new-object: error
no-new-symbol: error
no-new-wrappers: error
no-obj-calls: error
no-octal: error
no-octal-escape: error
no-path-concat: error
no-plusplus: error
no-proto: error
no-redeclare: error
no-regex-spaces: error
no-restricted-globals: error
no-return-assign: error
no-script-url: error
no-self-assign: error
no-self-compare: error
no-sequences: error
no-shadow: error
no-shadow-restricted-names: error
no-spaced-func: error
no-sparse-arrays: error
no-this-before-super: error
no-throw-literal: error
no-trailing-spaces: error
no-undef: error
no-undef-init: error
no-unexpected-multiline: error
no-unmodified-loop-condition: error
no-unneeded-ternary: error
no-unreachable: error
no-unsafe-finally: error
no-unused-expressions: error
no-unused-labels: error
no-unused-vars: error
no-useless-call: error
no-useless-computed-key: error
no-useless-concat: error
no-useless-constructor: error
no-useless-escape: error
no-void: error
no-warning-comments: warn
no-whitespace-before-property: error
no-with: error
operator-assignment: error
padded-blocks:
- error
- never
prefer-const: error
quote-props:
- error
- as-needed
radix: error
require-yield: error
semi: error
semi-spacing: error
space-before-blocks: error
space-in-parens: error
space-infix-ops:
- error
-
int32Hint: false
space-unary-ops: error
spaced-comment: error
use-isnan: error
valid-typeof: error
yield-star-spacing: error

View File

@ -0,0 +1,13 @@
name: CI
on: [push]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v1
- name: Run tests
run: ./run-tests
- name: Run against spec
run: ./run-spec

View File

@ -0,0 +1,45 @@
name: docker push
on: [push]
jobs:
push_to_registry:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Docker meta
if: startsWith(github.ref, 'refs/tags/')
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ghcr.io/${{ github.repository }}
tag-match: v(.*)
- name: Set up QEMU
if: startsWith(github.ref, 'refs/tags/')
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
if: startsWith(github.ref, 'refs/tags/')
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to GitHub Container Registry
if: startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
builder: ${{ steps.buildx.outputs.name }}
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker_meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
push: true

View File

@ -0,0 +1,9 @@
*.swp
diagnostic.partial
diagnostic.test
tests/*.diff
spec/
spec-runner/
node_modules/
package.json
package-lock.json

View File

@ -0,0 +1,616 @@
API / Function Documentation
============================
This documentation is generated automatically from the source of [mo] thanks to [tomdoc.sh].
`mo()`
------
Public: Template parser function. Writes templates to stdout.
* $0 - Name of the mo file, used for getting the help message.
* $@ - Filenames to parse.
Returns nothing.
`mo::debug()`
-------------
Internal: Show a debug message
* $1 - The debug message to show
Returns nothing.
`mo::debugShowState()`
----------------------
Internal: Show a debug message and internal state information
No arguments
Returns nothing.
`mo::error()`
-------------
Internal: Show an error message and exit
* $1 - The error message to show
* $2 - Error code
Returns nothing. Exits the program.
`mo::errorNear()`
-----------------
Internal: Show an error message with a snippet of context and exit
* $1 - The error message to show
* $2 - The starting point
* $3 - Error code
Returns nothing. Exits the program.
`mo::usage()`
-------------
Internal: Displays the usage for mo. Pulls this from the file that contained the `mo` function. Can only work when the right filename comes is the one argument, and that only happens when `mo` is called with `$0` set to this file.
* $1 - Filename that has the help message
Returns nothing.
`mo::content()`
---------------
Internal: Fetches the content to parse into MO_UNPARSED. Can be a list of partials for files or the content from stdin.
* $1 - Destination variable name
* $2-@ - File names (optional), read from stdin otherwise
Returns nothing.
`mo::contentFile()`
-------------------
Internal: Read a file into MO_UNPARSED.
* $1 - Destination variable name.
* $2 - Filename to load - if empty, defaults to /dev/stdin
Returns nothing.
`mo::indirect()`
----------------
Internal: Send a variable up to the parent of the caller of this function.
* $1 - Variable name
* $2 - Value
Examples
callFunc () {
local "$1" && mo::indirect "$1" "the value"
}
callFunc dest
echo "$dest" # writes "the value"
Returns nothing.
`mo::indirectArray()`
---------------------
Internal: Send an array as a variable up to caller of a function
* $1 - Variable name
* $2-@ - Array elements
Examples
callFunc () {
local myArray=(one two three)
local "$1" && mo::indirectArray "$1" "${myArray[@]}"
}
callFunc dest
echo "${dest[@]}" # writes "one two three"
Returns nothing.
`mo::trimUnparsed()`
--------------------
Internal: Trim leading characters from MO_UNPARSED
Returns nothing.
`mo::chomp()`
-------------
Internal: Remove whitespace and content after whitespace
* $1 - Name of the destination variable
* $2 - The string to chomp
Returns nothing.
`mo::parse()`
-------------
Public: Parses text, interpolates mustache tags. Utilizes the current value of MO_OPEN_DELIMITER, MO_CLOSE_DELIMITER, and MO_STANDALONE_CONTENT. Those three variables shouldn't be changed by user-defined functions.
* $1 - Destination variable name - where to store the finished content
* $2 - Content to parse
* $3 - Preserve standalone status/content - truthy if not empty. When set to a value, that becomes the standalone content value
Returns nothing.
`mo::parseInternal()`
---------------------
Internal: Parse MO_UNPARSED, writing content to MO_PARSED. Interpolates mustache tags.
No arguments
Returns nothing.
`mo::parseBlock()`
------------------
Internal: Handle parsing a block
* $1 - Invert condition ("true" or "false")
Returns nothing
`mo::parseBlockFunction()`
--------------------------
Internal: Handle parsing a block whose first argument is a function
* $1 - Invert condition ("true" or "false")
* $2-@ - The parsed tokens from inside the block tags
Returns nothing
`mo::parseBlockArray()`
-----------------------
Internal: Handle parsing a block whose first argument is an array
* $1 - Invert condition ("true" or "false")
* $2-@ - The parsed tokens from inside the block tags
Returns nothing
`mo::parseBlockValue()`
-----------------------
Internal: Handle parsing a block whose first argument is a value
* $1 - Invert condition ("true" or "false")
* $2-@ - The parsed tokens from inside the block tags
Returns nothing
`mo::parsePartial()`
--------------------
Internal: Handle parsing a partial
No arguments.
Indentation will be applied to the entire partial's contents before parsing. This indentation is based on the whitespace that ends the previously parsed content.
Returns nothing
`mo::parseComment()`
--------------------
Internal: Handle parsing a comment
No arguments.
Returns nothing
`mo::parseDelimiter()`
----------------------
Internal: Handle parsing the change of delimiters
No arguments.
Returns nothing
`mo::parseValue()`
------------------
Internal: Handle parsing value or function call
No arguments.
Returns nothing
`mo::isFunction()`
------------------
Internal: Determine if the given name is a defined function.
* $1 - Function name to check
Be extremely careful. Even if strict mode is enabled, it is not honored in newer versions of Bash. Any errors that crop up here will not be caught automatically.
Examples
moo () {
echo "This is a function"
}
if mo::isFunction moo; then
echo "moo is a defined function"
fi
Returns 0 if the name is a function, 1 otherwise.
`mo::isArray()`
---------------
Internal: Determine if a given environment variable exists and if it is an array.
* $1 - Name of environment variable
Be extremely careful. Even if strict mode is enabled, it is not honored in newer versions of Bash. Any errors that crop up here will not be caught automatically.
Examples
var=(abc)
if moIsArray var; then
echo "This is an array"
echo "Make sure you don't accidentally use \$var"
fi
Returns 0 if the name is not empty, 1 otherwise.
`mo::isArrayIndexValid()`
-------------------------
Internal: Determine if an array index exists.
* $1 - Variable name to check
* $2 - The index to check
Has to check if the variable is an array and if the index is valid for that type of array.
Returns true (0) if everything was ok, 1 if there's any condition that fails.
`mo::isVarSet()`
----------------
Internal: Determine if a variable is assigned, even if it is assigned an empty value.
* $1 - Variable name to check.
Can not use logic like this in case invalid variable names are passed. [[ "${!1-a}" == "${!1-b}" ]]
Returns true (0) if the variable is set, 1 if the variable is unset.
`mo::isTruthy()`
----------------
Internal: Determine if a value is considered truthy.
* $1 - The value to test
* $2 - Invert the value, either "true" or "false"
Returns true (0) if truthy, 1 otherwise.
`mo::evaluate()`
----------------
Internal: Convert token list to values
* $1 - Destination variable name
* $2-@ - Tokens to convert
Sample call:
mo::evaluate dest NAME username VALUE abc123 PAREN 2
Returns nothing.
`mo::evaluateListOfSingles()`
-----------------------------
Internal: Convert an argument list to individual values.
* $1 - Destination variable name
* $2-@ - A list of argument types and argument name/value.
This assumes each value is separate from the rest. In contrast, mo::evaluate will pass all arguments to a function if the first value is a function.
Sample call:
mo::evaluateListOfSingles dest NAME username VALUE abc123
Returns nothing.
`mo::evaluateSingle()`
----------------------
Internal: Evaluate a single argument
* $1 - Name of variable for result
* $2 - Type of argument, either NAME or VALUE
* $3 - Argument
Returns nothing
`mo::evaluateKey()`
-------------------
Internal: Return the value for @key based on current's name
* $1 - Name of variable for result
Returns nothing
`mo::evaluateVariable()`
------------------------
Internal: Handle a variable name
* $1 - Destination variable name
* $2 - Variable name
Returns nothing.
`mo::findVariableName()`
------------------------
Internal: Find the name of a variable to use
* $1 - Destination variable name, receives an array
* $2 - Variable name from the template
The array contains the following values
* [0] - Variable name
* [1] - Array index, or empty string
Example variables a="a"
b="b"
c=("c.0" "c.1")
d=([b]="d.b" [d]="d.d")
Given these inputs (function input, current value), produce these outputs a c => a
a c.0 => a
b d => d.b
b d.d => d.b
a d => d.a
a d.d => d.a
c.0 d => c.0
d.b d => d.b
'' c => c
'' c.0 => c.0
Returns nothing.
`mo::join()`
------------
Internal: Join / implode an array
* $1 - Variable name to receive the joined content
* $2 - Joiner
* $3-@ - Elements to join
Returns nothing.
`mo::evaluateFunction()`
------------------------
Internal: Call a function.
* $1 - Variable for output
* $2 - Content to pass
* $3 - Function to call
* $4-@ - Additional arguments as list of type, value/name
Returns nothing.
`mo::standaloneCheck()`
-----------------------
Internal: Check if a tag appears to have only whitespace before it and after it on a line. There must be a new line before and there must be a newline after or the end of a string
No arguments.
Returns 0 if this is a standalone tag, 1 otherwise.
`mo::standaloneProcess()`
-------------------------
Internal: Process content before and after a tag. Remove prior whitespace up to the previous newline. Remove following whitespace up to and including the next newline.
No arguments.
Returns nothing.
`mo::indentLines()`
-------------------
Internal: Apply indentation before any line that has content in MO_UNPARSED.
* $1 - Destination variable name.
* $2 - The indentation string.
* $3 - The content that needs the indentation string prepended on each line.
Returns nothing.
`mo::escape()`
--------------
Internal: Escape a value
* $1 - Destination variable name
* $2 - Value to escape
Returns nothing
`mo::getContentUntilClose()`
----------------------------
Internal: Get the content up to the end of the block by minimally parsing and balancing blocks. Returns the content before the end tag to the caller and removes the content + the end tag from MO_UNPARSED. This can change the delimiters, adjusting MO_OPEN_DELIMITER and MO_CLOSE_DELIMITER.
* $1 - Destination variable name
* $2 - Token string to match for a closing tag
Returns nothing.
`mo::tokensToString()`
----------------------
Internal: Convert a list of tokens to a string
* $1 - Destination variable for the string
* $2-$@ - Token list
Returns nothing.
`mo::getContentTrim()`
----------------------
Internal: Trims content from MO_UNPARSED, returns trimmed content.
* $1 - Destination variable
Returns nothing.
`mo::getContentComment()`
-------------------------
Get the content up to and including a close tag
* $1 - Destination variable
Returns nothing.
`mo::getContentDelimiter()`
---------------------------
Get the content up to and including a close tag. First two non-whitespace tokens become the new open and close tag.
* $1 - Destination variable
Returns nothing.
`mo::getContentWithinTag()`
---------------------------
Get the content up to and including a close tag. First two non-whitespace tokens become the new open and close tag.
* $1 - Destination variable, an array
* $2 - Terminator string
The array contents: [0] The raw content within the tag
[1] The parsed tokens as a single string
Returns nothing.
`mo::tokenizeTagContents()`
---------------------------
Internal: Parse MO_UNPARSED and retrieve the content within the tag delimiters. Converts everything into an array of string values.
* $1 - Destination variable for the array of contents.
* $2 - Stop processing when this content is found.
The list of tokens are in RPN form. The first item in the resulting array is the number of actual tokens (after combining command tokens) in the list.
Given: a 'bc' "de\"\n" (f {g 'h'}) Result: ([0]=4 [1]=NAME [2]=a [3]=VALUE [4]=bc [5]=VALUE [6]=$'de\"\n' [7]=NAME [8]=f [9]=NAME [10]=g [11]=VALUE [12]=h [13]=BRACE [14]=2 [15]=PAREN [16]=2
Returns nothing
`mo::tokenizeTagContentsName()`
-------------------------------
Internal: Get the contents of a variable name.
* $1 - Destination variable name for the token list (array of strings)
Returns nothing
`mo::tokenizeTagContentsDoubleQuote()`
--------------------------------------
Internal: Get the contents of a tag in double quotes. Parses the backslash sequences.
* $1 - Destination variable name for the token list (array of strings)
Returns nothing.
`mo::tokenizeTagContentsSingleQuote()`
--------------------------------------
Internal: Get the contents of a tag in single quotes. Only gets the raw value.
* $1 - Destination variable name for the token list (array of strings)
Returns nothing.
`MO_ORIGINAL_COMMAND`
---------------------
Save the original command's path for usage later
[mo]: ./mo
[tomdoc.sh]: https://github.com/tests-always-included/tomdoc.sh

View File

@ -0,0 +1,7 @@
FROM alpine
RUN apk add --no-cache bash
ADD mo /usr/local/bin/mo
RUN chmod +x /usr/local/bin/mo
ENTRYPOINT /usr/local/bin/mo

View File

@ -0,0 +1,7 @@
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization.
The end-user documentation included with the redistribution, if any, must include the following acknowledgment: "This product includes software developed by contributors", in the same place and form as other third-party acknowledgments. Alternately, this acknowledgment may appear in the software itself, in the same form and location as other such third-party acknowledgments.

View File

@ -0,0 +1,340 @@
Mo - Mustache Templates in Bash
===============================
[Mustache] templates are simple, logic-less templates. Because of their simplicity, they are able to be ported to many languages. The syntax is quite simple.
Hello, {{NAME}}.
I hope your {{TIME_PERIOD}} was fun.
The above file is [`demo/fun-trip.mo`](demo/fun-trip.mo). Let's try using this template some data from bash's environment. Go to your checked out copy of the project and run a command like this:
NAME=Tyler TIME_PERIOD=weekend ./mo demo/fun-trip.mo
Your result?
Hello, Tyler.
I hope your weekend was fun.
This bash version supports conditionals, functions (both as filters and as values), as well as indexed arrays (for iteration). You are able to leverage these additional features by adding more information into the environment. It is easiest to do this when you source `mo`. See the [demo scripts](demo/) for further examples.
Requirements
------------
* Bash 3.x (the aim is to make it work on Macs)
* The "coreutils" package (`basename` and `cat`)
* ... that's it. Why? Because bash **can**!
If you intend to develop this and run the official specs, you also need node.js.
Installation
------------
There are a few ways you can install this tool. How you install it depends on how you want to use it.
### Globally; For Everyone
You can install this file in `/usr/local/bin/` or `/usr/bin/` by simply downloading it, changing the permissions, then moving it to the right location. Double check that your system's PATH includes the destination folder, otherwise users may have a hard time starting the command.
# Download
curl -sSL https://raw.githubusercontent.com/tests-always-included/mo/master/mo -o mo
# Make executable
chmod +x mo
# Move to the right folder
sudo mv mo /usr/local/bin/
# Test
echo "works" | mo
### Locally; For Yourself
This is very similar to installing it globally but it does not require root privileges. It is very important that your PATH includes the destination folder otherwise it won't work. Some local folders that are typically used are `~/bin/` and `~/.local/bin/`.
# Download
curl -sSL https://raw.githubusercontent.com/tests-always-included/mo/master/mo -o mo
# Make executable
chmod +x mo