prep 0.1.1+3 copy "prep: ^0.1.1+3" to clipboard
prep: ^0.1.1+3 copied to clipboard

discontinued
outdated

Inspired by the C preprocessor, prep helps you manage your source code.

Welcome to prep #

Prep is inspired by the C preprocessor and helps you manage your source code.

Example: #

Basics: #

1/3 - Examine the following code (prep_example.dart):

// <##Title>
// <#Author=>
// <#Date=>
// <#Time=>
import 'package:prep/prep.dart';

void main() {
  // Process source files as per prep.yaml.
  prep();
  print("Follow me on Instagram " + "<#Instagram=>".value);
  print("This file is " + "<#f=>".value);
  print("This line is number " + "<#l=>".value);
  // Use double ## to completely replace.
  print("And this line is number " + "<##l>");
  print("The time now is " + "<#t>".value);
  // Package as per pubspec.yaml.
  print("This package is " + "<#Package>".value);
  // Version as per pubspec.yaml.
  print("The package version is " + "<#Version>".value);
  print("Let's print the USERNAME environment variable: " +
      "<#ENV USERNAME=>".value);
}

2/3 - After running the code above, it will be modified to this:

// PREP EXAMPLE
// <#Author = Robert Mollentze>
// <#Date = 8/26/2021>
// <#Time = 23:15>
import 'package:prep/prep.dart';

void main() {
  // Process source files as per prep.yaml.
  prep();
  print("Follow me on Instagram " + "<#Instagram = @robmllze>".value);
  print("This file is " + "<#f=prep_example.dart>".value);
  print("This line is number " + "<#l=20>".value);
  // Use double ## to completely replace.
  print("And this line is number " + "22");
  print("The time now is " + "<#t=23:15>".value);
  // Package as per pubspec.yaml.
  print("This package is " + "<#Package = prep>".value);
  // Version as per pubspec.yaml.
  print("The package version is " + "<#Version = 0.1.1>".value);
  print("Let's print the USERNAME environment variable: " +
      "<#ENV USERNAME = guest>".value);;
}

3/3 - Finally, this will be the output:

Follow me on Instagram @robmllze
This file is prep_example.dart
This line is number 20
And this line is number 22
The time now is 23:15
This package is prep
The package version is 0.1.1
Let's print the USERNAME environment variable: guest

Expressions: #

Current Time: #

Update: <#Time= > or <#t= >

Replace: <##Time> or <##t>

Relative Path of Current File: #

Update: <#Path= > or <#p= >

Replace: <##Path> or <##p>

Short File Name of Current File: #

Update: <#File= > or <#f= >

Replace: <##File> or <##f>

Current Line: #

Update: <#Line= > or <#l= >

Replace: <##Line> or <##l>

File Title: #

Update: <#Title= >

Replace: <##Title>

Environment Variables: #

Update: <#ENV PATH= > or <#ENV COMPUTERNAME= > or <#ENV USERNAME= > etc.

Replace: <##ENV PATH> or <##ENV COMPUTERNAME> or <#ENV USERNAME> etc.

Comment Breaks: #

// <##br-heavy>

// <##br-medium>

// <##br-light>

// <##br-dash>

// <##br-line>

Installing: #

dev_dependencies:
  prep: ^0.1.1 #https://pub.dev/packages/prep

Configuring: #

Add the following to prep.yaml in your project's root directory:

# This file was auto-generated by prep().
# Rename it to "prep.yaml" to use it.
# If you like this package, please follow me on Instagram @robmllze.
# Feel free to DM me about bugs or questions.

# Files in this directory and all its subdirectories will be parsable.
path: "."

# If you need to tweak the syntax, do it here.
# Note: This is experimental!
syntax_beg: "<" # This also works well: "`"
syntax_end: ">" # This also works well: "`"
syntax_sep: "=" # This also works well: ":"

# Set to true to include your environment variables.
# Note: This significantly slows down the prep function but it does
# not matter if you use it asynchronously.
include_env: true

# Specify which custom fields to update.
update_these_fields: {
  "Author": "Robert Mollentze",
  "GitHub": "@robmllze",
  "Instagram": "@robmllze",
  "Email": "robmllze@gmail.com,"
}

# Specify which file types to parse.
parse_these_file_types: [
  "dart",
  "md",
  "yaml",
]

# Specify which files not to parse.
dont_parse_these_files: [
  "prep.yaml",
  "README.md",
]

See Other Packages by @robmllze: #

5
likes
0
pub points
0%
popularity

Publisher

unverified uploader

Inspired by the C preprocessor, prep helps you manage your source code.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

meta, yaml

More

Packages that depend on prep