Coder Social home page Coder Social logo

craft-roman's Introduction

iconRoman

Craft CMS 4.0.0+ Scrutinizer Code Quality

Convert an integer into roman numerals and vice versa.

Roman banner

— Based on the Craft 2 version of the Roman plugin by Bransin Anderson

Installation

Requirements

This plugin requires Craft CMS 4.0.0 or later.

Plugin Store

Log into your control panel and click on 'Plugin Store'. Search for 'Roman'.

Composer

  1. Open your terminal and go to your Craft project:
cd /path/to/project
  1. Then tell Composer to load the plugin:
composer require jalendport/craft-roman
  1. In the Control Panel, go to Settings → Plugins and click the “Install” button for Roman.

Using Roman

Roman provides several Twig methods for easy conversion between integers and roman numerals:

  • You can pass an integer (or a string) into the getRoman() method to get roman numerals:

    {{ craft.roman.getRoman(298) }}     // Output: CCXCVIII
    {{ craft.roman.getRoman('539') }}   // Output: DXXXIX
    
  • You can pass a string (of roman numerals) into the getNumber() method to get an integer:

    {{ craft.roman.getNumber('ML') }}   // Output: 1050
    
  • Roman also includes a helper attribute to quickly get the current year in roman numeral form:

    {{ craft.roman.currentYear }}       // Output: MMXXIII
    

Found a Bug? Need Support?

Please open an issue describing what's going wrong.

Roadmap

Some things to do, and ideas for potential features:

  • Twig filter for converting all integers in a string of text to roman numerals.

If there's a feature you think should be added to Roman, please open an issue. PRs are also welcome!


Contributors

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.