{"id":28231913,"url":"https://github.com/plytonrexus/if-script","last_synced_at":"2025-09-01T08:38:29.453Z","repository":{"id":40673825,"uuid":"274501764","full_name":"PlytonRexus/if-script","owner":"PlytonRexus","description":"An extremely simple syntax for writing interactive fiction that can be embedded anywhere on the web.","archived":false,"fork":false,"pushed_at":"2023-03-06T02:52:41.000Z","size":3644,"stargazers_count":10,"open_issues_count":45,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-18T19:11:20.829Z","etag":null,"topics":["choice-syntax","embedded","hacktoberfest","interactive-fiction","syntax","text-adventure-game"],"latest_commit_sha":null,"homepage":"https://plytonrexus.github.io/if-script/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PlytonRexus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-23T20:24:37.000Z","updated_at":"2024-03-31T10:44:52.000Z","dependencies_parsed_at":"2023-02-08T03:30:16.704Z","dependency_job_id":null,"html_url":"https://github.com/PlytonRexus/if-script","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/PlytonRexus/if-script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlytonRexus%2Fif-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlytonRexus%2Fif-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlytonRexus%2Fif-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlytonRexus%2Fif-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PlytonRexus","download_url":"https://codeload.github.com/PlytonRexus/if-script/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlytonRexus%2Fif-script/sbom","scorecard":{"id":110833,"data":{"date":"2025-08-11","repo":{"name":"github.com/PlytonRexus/if-script","commit":"54427ab7cf04eda43bd956595a148e3a5b0e790d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.8,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 1/8 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'master'","Warn: could not determine whether codeowners review is allowed","Warn: no status checks found to merge onto branch 'master'","Warn: PRs are not required to make changes on branch 'master'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"53 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-q8pj-2vqx-8ggc","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-6h5x-7c5m-7cr7","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc","Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp","Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-76c9-3jph-rj3q","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-hgjh-723h-mx2j","Warn: Project is vulnerable to: GHSA-jf5r-8hm2-f872","Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6","Warn: Project is vulnerable to: GHSA-4v9v-hfq4-rm2v","Warn: Project is vulnerable to: GHSA-9jgg-88mc-972h","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-15T12:10:13.910Z","repository_id":40673825,"created_at":"2025-08-15T12:10:13.910Z","updated_at":"2025-08-15T12:10:13.910Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273094228,"owners_count":25044440,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["choice-syntax","embedded","hacktoberfest","interactive-fiction","syntax","text-adventure-game"],"created_at":"2025-05-18T19:10:59.277Z","updated_at":"2025-09-01T08:38:29.447Z","avatar_url":"https://github.com/PlytonRexus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IF-SCRIPT\nA straightforward syntax for writing interactive fiction can be embedded in any website.\n\nMake interactive fiction with variables, timers, conditions, music and statistics. The story is parsed into plain HTML, CSS and JavaScript.\n\n[Try it!](https://plytonrexus.github.io/if-script/)\n\nYou can use Markdown to format your story. \n_[Markdown cheat-sheet](https://www.markdownguide.org/cheat-sheet/) for reference._\n\n### Dependencies\n[Nearley](https://github.com/kach/nearley) for parsing.\n[Showdown](https://github.com/showdownjs/showdown) for markdown rendering.\n\nA Regular Expression based parser is on the [if-script-regex](https://github.com/PlytonRexus/if-script/tree/if-script-regex) branch.\n\n### [Embedding](#embedding)\n\nWithin the head tag, add the following.\n\n```html\n\u003clink rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/gh/plytonrexus/if-script@v0.4-alpha/downloadable/if_r.css\"\u003e\n```\n\nIn your body, add the following scripts.\n\n```html\n\u003cdiv id=\"if_r-output-area\"\u003e\u003c/div\u003e\n\u003cscript src=\"Story.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/gh/plytonrexus/if-script@v0.4-alpha/js/if_r-terp.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/showdown@1.9.1/dist/showdown.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e IF.methods.loadStory(IF.story); \u003c/script\u003e\n```\n\n*The indentation does not matter.*\n\n### [Comments](#comments)\n\nA comment is a text block that is not integrated into the final model of the story. Comments exist to help write cleaner stories, for example, by pointing out the purposes of certain portions of the story.\n```\n/* A\n multi-line\n comment */\n ```\n\n### [Variables](#variables)\n\nVariables truly create dynamic stories. You can use variables to store many things like character names, inventory items, visited scenes, number of things and many others. You can then display the values of these variables anywhere like so:\n```\nYour name is ${name}.\n```\nHere, variable `name` was used to store the name of a character.\n The variables can also be used in conditional logic to determine which [choices](#choice-syntax) and (in a future release) what paragraphs of a [section's](#section-syntax) text should be visible to the reader. You can find more about this under the [choices](#choice-syntax) heading.\n\nYou can assign variables beforehand inside story [settings](#settings-syntax).\n\n```\n${name='Felicity'}\n```\n\n *It is recommended (albeit not required) to keep the* `title`*variable set as the title of the story.*\n\n### [Story Settings](#story-settings)\n\nStory settings allow you to customise the overall experiance of the story. All of the settings are optional. The available settings are:\n\n-   `@startAt` decides the starting section of a story. (Default: 1)\n-   `@referrable` decides if the older sections remain visible once the reader moves to a new section. (Default: false)\n-   `@fullTimer` decides the amount of time alloted for completing a story. (Default: none)\n```\nsettings\u003e\n   @startAt\n   @referrable\n   @fullTimer\n\u003csettings\n```\n\n### [Scenes](#scenes)\n\nScenes are collections of [sections](#scene-syntax)\n```\nscene\u003e\n   @first section_number (optional)\n   @music link (optional)\n   @sections space_seperated_section_numbers\n   @name custom_name_for_scene\n \u003cscene\n````\n### [Sections](#section-syntax)\n\nSections are independent locations/situations in a story. These can be reached through [choices](#choice-syntax). Each section can have its own set of settings that allow it to have separate timers that send the reader to a separate section if they do not choose within specified time, and its own music. These features are beneficial in dramatic situations.\n```\nss\u003e\n   tt\u003e Section Title \u003ctt\n   Section text.\n   In paragraphs.\n   You can use variables here.\n   /*\n     You can write choices about now.\n     Read on to find out how to create them.\n   */\n\u003css\n```\n### [Choices](#choices)\n\nChoice are the sole method to navigate a story by reaching [sections](#section-syntax) or [scenes](#scene-syntax). To send to a section:\n```\nch\u003e\n   You are named five [[5]]\n\u003cch\n```\nTo send to the beginning of a scene:\n```\nch\u003e\n   You are named five [[scene:5]]\n\u003cch\n```\nChoices can assign variables.\n```\nch\u003e\n   Choose 'Felicity' as your name ${__name} [[5]]\n \u003cch\n```\nChoices can also have input boxes. These input boxes can be used to take in custom values from the user and then stored in variables for later use.\n```\nch\u003e\n   Type in your name here: __input ${__name} [[5]]\n\u003cch\n```\nChoices can have conditions. Only if these conditions are met is the choice displayed. Available operators are:\n\n-   ` var1 == var2`   Both are equal\n-   ` var1 != var2`   Both are inequal\n-   ` var1 \u003e= var2`   First is greater than or equal to second\n-   ` var1 \u003c= var2`   Second is greater than or equal to first\n-   ` var1 \u003e  var2`   First is greater than second\n-   ` var1 \u003c  var2`   Second is greater than first\n```\nch\u003e\n   ${__if name == \"\" || namePower \u003c= 0}\n     Type in your name here __input ${__name} [[5]]\n\u003cch\n```\nChoices can also do actions like addition (+), subtraction (-), multiplication (\\*) and division (/) on variables.\n\n- `${__var1 = var2}` Assignment\n- `${__var1 + var2}` Addition\n- `${__var1 - var2}` Subtraction\n- `${__var1 * var2}` Multiplication\n- `${__var1 / var2}` Division\n\nIn each of these, the first variable is assigned values that result from the operation.\n```\nch\u003e\n   The power of your name goes up 10 units, and your health \n    is multiplied \\${namePower} times.\n   ${__namePower + 10} ${__health * namePower} [[5]]\n\u003cch\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplytonrexus%2Fif-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplytonrexus%2Fif-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplytonrexus%2Fif-script/lists"}