While reviewing and polishing Northwind Elixir Traders
(my book on modeling and working with SQLite databases with Elixir and Ecto) on its way to 100% completion, I decided to hyperlink all mentions to functions and modules of Elixir, Ecto, Ecto.SQL and Ecto SQLite3 in the Markdown source of the book to the corresponding Elixir documentation page. This makes it easier for the reader to access documentation and look up each module or each function’s head and any of its available options, both for understanding what is happening in the code snippets we run in IEx and in the code blocks of the NorthwindElixirTraders
Elixir application we develop step by step throughout the book.
As the review progressed, I found myself copying and pasting more of the same chunks of text from earlier part of the text that had already referred to a function. It became a hassle to lose my position in a text file by Ctrl-f
-ing a function name, then select and copy the chunk of the hyperlinked function name, and then get back to where I was earlier, to paste it there.
The following command extracts all those hyperlinks from the Markdown files. I keep its output open in a text editor, so that I can copy the hyperlinked module or function references into the Northwind Elixir Traders text while reviewing without losing track of where I am:
grep -hoP '\[`([A-Z][A-Za-z0-9_.]*)?(?:[a-z_]+)?\/?\d?`\]\((?!#)[^)]*\)' *.md | sort | uniq
This also matches hyperlinks to SQLite functions on sqlite.org . For the record, as I’m currently in the middle of reviewing Chapter 15 on more and more-advanced queries with windows, window functions, window aggregates and partitioning, these are the modules and functions used thus far in the book:
add/3
add_error/4
aggregate/3
all/2
all_loaded/0
alter/2
Application
apply_action/2
apply_changes/1
assoc/3
async_stream/3
avg/1
belongs_to/3
belongs_to
cast/4
cast_assoc/3
change/2
code
compare/2
constraint/3
constraints/1
count/1
count/1
create/1
CURRENT_TIMESTAMP
Date.add/2
Date.compare/2
Date.diff/2
Date.end_of_month/1
Date
DateTime.add/4
DateTime.compare/2
DateTime
delete/2
delete_all/2
diff/2
distinct/3
drop/2
dynamic/2
Ecto.Adapter
Ecto.Adapters.Postgres
Ecto.Adapters.SQL.query/4
Ecto.Adapters.SQL.to_sql/3
Ecto.assoc/3
Ecto.Changeset.add_error/4
Ecto.Changeset.change/1
Ecto.Changeset.foreign_key_constraint/3
Ecto.Changeset.get_field/3
Ecto.Changeset
Ecto.Changeset.unique_constraint/3
Ecto.Changeset.validate_length/3
EctoCommons.DateValidator
Ecto.Enum
Ecto.Migration.add/3
Ecto.Migration.create/1
Ecto.Migration.create/2
Ecto.Migration.drop/2
Ecto.Migration.execute/2
Ecto.Migration
Ecto.Migration.remove/1
Ecto.Migration.table/2
Ecto.Migration.timestamps/1
Ecto.Query.API.field/2
Ecto.Query.API.fragment/1
Ecto.Query.API
Ecto.Query.distinct/3
Ecto.Query.dynamic/2
Ecto.Query
Ecto.Query.join/5
Ecto.Query.preload/3
Ecto.Query.select_merge/3
Ecto.Query.subquery/1
Ecto.Query.WindowAPI
Ecto.Query.windows/3
Ecto.Repo.aggregate/3
Ecto.Repo.aggregate/4
Ecto.Repo
Ecto.Repo.insert/2
Ecto.Schema.field/3
Ecto.Schema
Ecto.Schema.many_to_many/3
Ecto.Schema.schema/2
Ecto.Schema.timestamps/1
Ecto.Schema.__using__/1
Enum.each/2
Enumerable
Enum.filter/2
Enum.frequencies/1
Enum.group_by/3
Enum
Enum.map/2
Enum.reduce/3
Enum.reduce_while/3
Enum.reverse/1
Enum.sort_by/3
Enum.sum/1
Enum.sum_by/2
Enum.to_list/1
Enum.uniq/1
Enum.zip/2
execute/1
expr
field/2
field/3
first_value/1
Float.round/2
for/1
fragment/1
from/2
Function.identity/1
GenServer
get/3
get_by/3
get_change/2
get_dynamic_repo/0
get_field/3
group_by/3
has_many/3
has_many
having/3
httpc
httpc
if/2
ilike/2
index/3
inets
insert/2
insert_or_update/2
IO.puts/2
is_integer/1
join/5
Kernel.apply/3
Kernel.defdelegate/2
Kernel
Kernel.round/1
Kernel.struct/1
Kernel.then/2
Keyword.get/2
Keyword
Keyword.put/3
length/1
like/2
limit/3
Logger
lookup_meta/1
Macro.underscore/1
many_to_many/3
Map.get/3
Map.put/3
Map.take/2
Map.values/1
max/1
max/1
Migrator
min/1
min/1
Mix.Project
modify/3
Module.concat/1
Module
Module.put_attribute/3
Module.register_attribute/3
one/2
order_by/3
over/2
password_changeset/3
preload/3
preload/3
prep_stop/1
put_assoc/4
put_change/3
put_dynamic_repo/1
references/2
Regex.replace/4
registration_changeset/3
rename/2
rename/3
Repo.aggregate/3
Repo.all/2
Repo.delete_all/2
Repo.get/3
Repo.get_by/3
Repo.insert/2
Repo.one/2
Repo.preload/3
Repo.query/3
request/1
round/1
schema/2
select/3
select
select_merge/3
shift_zone/3
ssl
start/2
start_link/2
start_link/3
stop/1
Stream.filter/2
Stream
Stream.map/2
String.to_existing_atom/1
struct/2
sum/1
sum/1
Supervisor
System.schedulers_online/0
table/2
Task.async_stream/3
Task
tc/1
then/2
timer
timestamps/1
timestamps/1
traverse_errors/2
trunc/1
tzdata
unique_constraint/3
unique_index/3
unless
update/2
use
utc_today/1
v/1
validate_change/4
validate_format/4
validate_length/3
validate_number/3
validate_password/2
validate_required/3
validations/1
where/2
where/3
windows/3
with/1
with_cte/3