-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Flavio Poletti edited this page Jun 18, 2016
·
38 revisions
There is a site about Data::Tubes, including a manual that will keep you busy for some time.
If you want to get started quickly, you might want to download tubergen (info here) and take a look at a few examples:
- [Let's Marry!](Let's Marry!) - a full-fledged example where a template and a data source are blended to produce wedding invitations!
If you're curious about specific topics, the following pages might help you better. They try to describe the different components more from a usage point of view (with examples) than to provide a comprehensive description (that you would find in the modules documentation anyway).
- [Handling Sources](Handling Sources) - a few ways you might use to iterate on your inputs, if you're lucky enough to have them in an array or stored in files.
- [Reading Text Inputs](Reading Text Inputs) - if your input is text, you might want to chunk it before parsing. Is your data arranged line by line? We've got you covered. Paragraphs maybe? We've got you covered. Some fancy separator? You guess. A regular expression? Ehr... you will have to wait for this...
- Parsing has a lot of cards up the sleeve:
-
Parsing
by_format
- if your lines have a clean, fixed structure, this might be your best shot -
Parsing
by_value_separator
- let's just say that you have something similar to aformat
, but you want to keep the separator under control! -
Parsing
by_regex
- are you a regular expression guru? Do you know how to use capturing groups in regular expressions? And, more than this: are you aware that to solve one problem with regular expressions means having two problems? -
Parsing hashy stuff - is your
input sort-of-hashy, but it's complicated? Take a look at what
hashy
andghashy
have to offer!
-
Parsing
-
Validating - adding validation in a pipeline is as easy as
just adding a sub reference in the middle, but there might be some value
in using what's shipped with
Data::Tubes
, so don't skip over this too quickly. -
Rendering
with_template_perlish
- an in-depth overview of the rendering process via Data::Tubes::Plugin::Renderer. - Writing is possibly one of the most flexible tools that
Data::Tubes
has to offer, so it's definitely worth a look:-
Writing
to_files
helps you to send out data to files and handles as well, in a quite flexible way -
Writing with
dispatch_to_files
if you need some extra flexibility on top ofto_files
, we might have something for you, be sure to check it out!
-
Writing
- What if you need some help distributing water here and there? Like...
- trying successive
alternatives
until one succeeds; - trying successive
fallback
s when exceptions are thrown; -
dispatch
ing to sub-tubes based on custom rules that you control; -
cache
-ing things so you don't have to load/fetch/compute them over and over?
- trying successive
You're encouraged to contribute yours... just create new pages in this Wiki!