# RouteDoc > RouteDoc (https://routedoc.com) is a free trip planner built on plain text. You write an itinerary in a small line-based syntax, paste it into the editor, and the places and routes appear on an interactive map. This file is the complete syntax guide, written for AI assistants that have been asked to write a RouteDoc itinerary for someone. ## What to hand back Write the itinerary in the syntax below and return it inside one fenced code block. The person copies it and pastes it into the editor at https://routedoc.com, or saves it as a .txt file and uses the Import button. There is no account and nothing to upload. The code block matters. Outside a code block, chat apps treat the syntax as formatting: `---` turns into a horizontal rule, `>(walk)` into a quote, `[ ]` into a checkbox, and `` lines can disappear because they look like HTML tags. Place lookups are not perfect, so suggest that the person glances over the map after pasting. If a pin is in the wrong spot, or a place is underlined in red, the fix is a more exact name for that place. ## A link that opens the trip (only if you can run code) RouteDoc can open an itinerary straight from a link, so the person clicks once and sees the map with nothing to copy or paste. You can make that link if you have a tool that runs code, such as a Python or JavaScript sandbox. The link is an extra and never a replacement. Always give the code block as well: the person can read it, and it still works if the link is damaged on its way to them. If you cannot run code, skip this section: give the code block and do not offer a link. The packed part of a link is compressed and ends in a checksum, so it cannot be written, estimated or edited by hand. A link with even one wrong character does not open the trip. The person gets an error message. A link is `https://routedoc.com/?trip=1` followed directly by the packed itinerary. To pack it: 1. Start from the exact text of the itinerary: the same lines as in your code block, with no indentation added, joined by `\n`. Do not use `\r\n`. 2. Encode the text as UTF-8. 3. Compress the bytes into the zlib format. `zlib.compress` in Python, `zlib.deflateSync` in Node.js and `CompressionStream('deflate')` in a browser all produce it. Gzip and raw deflate are different formats and will not open. 4. Write the compressed bytes in URL-safe base64, which uses `-` and `_` where ordinary base64 uses `+` and `/`. Take the `=` padding off the end. The `1` straight after `trip=` is the format version. It is not part of the packed text, and every link has it. In Python, with the itinerary in a string named `itinerary`: import base64, zlib packed = base64.urlsafe_b64encode(zlib.compress(itinerary.encode("utf-8"))) link = "https://routedoc.com/?trip=1" + packed.decode("ascii").rstrip("=") print(link) When you give the link: - Copy it from your code's output character for character. Do not retype it, shorten it, break it across lines or put punctuation straight after it. - It will be long: a few hundred characters for a weekend, a thousand or more for a week. Where Markdown links work, give it a short label, such as "Open this trip in RouteDoc", so the address does not fill the reply. - Make the link from the final text. If you change the itinerary afterwards, run the code again. An old link still opens the old itinerary. - Leave the link out if it comes to more than 15,000 characters. RouteDoc itself will not make a link longer than that. - Tell the person what to expect. The link opens the trip on the map. If they already have a trip of their own in RouteDoc in that browser, they are asked before it is replaced. ## A small example ```text Paris and Rome - June [ ] Book train tickets [x] Hotel booked --- Day 1: Paris >(walk) 10:00 @(Louvre Museum, Paris) Use the Carrousel entrance, the queue is shorter [ ] Reserve a time slot 13:00 @(Tuileries Garden, Paris) >(transit) 19:30 @(Eiffel Tower, Paris) --- Day 2: Fly to Rome >(car) @(Paris Charles de Gaulle Airport, France) >(plane) @(Rome Fiumicino Airport, Italy) >(train) @(Roma Termini, Rome) >(walk) 16:00 @(Colosseum, Rome) ``` How to read it: - Everything before the first `---` is the header: a title, then notes and to-dos for the whole trip. - Each `---` line starts a new day. - Inside a day, places are joined by route lines in the order they are written. A `>(mode)` line says how to travel from the place above it to the place below it. - A plain line under a place is a note about that place. ## Line types There are six kinds of line. The first five each have an exact pattern. A line that does not match a pattern exactly is not an error: it is kept as a note. That is forgiving for people typing by hand, but it means a small slip (a bullet in front, a capital letter in a mode, words after the closing bracket) quietly turns a place into a note with no pin on the map. Every pattern starts at the first character of its line. Do not indent, number or bullet these lines. ### Place ```text @(Louvre Museum, Paris) 14:00 @(Louvre Museum, Paris) ``` - Puts a pin on the map. The pins of a day are numbered in the order the places are written, starting again at 1 on each day. - A time may go in front, followed by a space. Use the 24-hour clock with a colon: `9:00`, `14:30`. Forms like `2:30 PM`, `9am`, `14h` and `14:00-16:00` do not work. Times are optional. - A time is only recognised in front of a place. - Nothing may follow the closing bracket. Put extra words on the next line as a note. - One place per line, alone on the line. `Lunch at @(Cafe de Flore, Paris)` is a note, not a place. Naming the place well is the part that most affects the result. The text in the brackets is sent to a place-name search and the pin goes on the first match. The search almost never comes back empty, so a vague or unusual name does not fail: it puts the pin somewhere wrong, usually the middle of the city and occasionally another country. To get the right pin: - Write the name, then a comma, then the city: `@(Louvre Museum, Paris)`. - Use the name a map would show. World-famous sights are found by their English names (`Eiffel Tower`, `Colosseum`). For anything else the official local name is safer: `@(Jardin du Luxembourg, Paris)` is found where `@(Luxembourg Gardens, Paris)` is not, and `@(Ponte Dom Luis I, Porto)` is found where `@(Luis I Bridge, Porto)` is not. - Airports are written differently. They sit outside the city they are named after, and naming the city pulls the pin to the city centre or further: `@(Porto Airport, Porto)` lands in Brazil. Write the full airport name and the country instead: `@(Paris Charles de Gaulle Airport, France)`, `@(London Heathrow Airport, United Kingdom)`. - Only use real, specific places. A description such as `@(a nice cafe by the river)` still gets a pin, in a random place. Write it as a note instead. - Accented and non-Latin characters are fine. ### Day ```text --- Day 1: Arrival ``` - Exactly three hyphens, then a space, then a label of your choice. The label is shown in the map legend, so keep it short. The label can be left out, leaving `---` on its own. - `----`, `---Day 1` (no space), `***`, `## Day 1` and `Day 1:` do not start a day. - Each day is drawn in its own colour, running from light on the first day to dark on the last. ### Travel ```text >(walk) ``` - Goes on its own line between two places and sets how the leg between them is drawn. - There are exactly five modes, all lowercase: - `walk` - a real walking route along paths - `car` - a real driving route along roads; use it for taxis too - `transit` - a straight dashed line; use it for metro, bus, tram, ferry and boat - `train` - a straight dashed line; use it for intercity rail - `plane` - a curved arc; use it for flights - A mode stays in force for the rest of the day, until another `>(mode)` line changes it. You do not need to repeat it between every pair of places. It resets at the start of each day. - Until a mode is set in a day, the trip default applies. The default is `car`. To change the default for the whole trip, put one `>(mode)` line in the header. For a city trip on foot, `>(walk)` in the header is a good choice. - `walk` and `car` follow real roads and paths, so both ends of the leg must be somewhere a road or path reaches. A lake, a mountain or a national park is pinned at its centre, which is usually in the water or the wilderness, and the route to it fails. Name the visitor centre, lookout, car park or nearest town instead: `@(Lake Pukaki Visitor Centre, New Zealand)` gets a driving route where `@(Lake Pukaki, New Zealand)` does not. - `walk` and `car` also fail across open water. Use `plane`, `train` or `transit` for those legs. Those three always draw. ### Staying somewhere ```text ``` - Marks accommodation with its own pin, which shows a bed and has no number. The part in the round brackets is named the same way as a place. - A time cannot go in front of these lines. - They can go in the header or inside a day. Inside a day they also count as a stop on that day's route, so the route line runs to the hotel and on from it. In the header they are a pin only. - Only use them for accommodation the person has named or has asked you to choose. An invented name puts a pin on a real building they are not staying in. If the accommodation is not decided, leave these lines out, add a to-do such as `[ ] Book a motel in Lake Tekapo`, and use the town itself as the place where the day ends: `@(Lake Tekapo, New Zealand)`. ### To-do ```text [ ] Book train tickets [x] Hotel booked ``` - `[ ]` is not done and `[x]` is done. The `x` is lowercase, and a space follows the closing bracket. - No list marker in front: `- [ ] Book tickets` is a note. ### Note Any other line is a note. Use notes for tips, opening hours, booking references, costs and anything else. Blank lines are fine anywhere. Notes and to-dos written directly under a place (or under a check-in or check-out) belong to that place and are shown when someone hovers over its pin. So inside a day, write things in this order: the place, then its notes and to-dos, then the `>(mode)` line for the leg to the next place. ## How days and routes work - Start the document with a title line. The first plain line of the header is the trip title. - Route lines only join places within the same day. Nothing is drawn from the last place of one day to the first place of the next. - So a journey between two cities has to sit inside one day. Put the departure point and the arrival point in the same day, with the `>(plane)` or `>(train)` line between them. Day 2 of the example above does this. - To show the leg from the hotel each morning, start the day with the hotel written as a place, like `@(Hotel Lutetia, Paris)`. - If one end of a journey is unknown, such as a flight home to a city the person has not named, end the day at the airport or station and mention the journey in a note. - The same place can appear as many times as needed. - Places written in the header get a pin but no route lines. ## Check before you answer 1. The whole itinerary is in one code block, and it is plain text. Markdown bold, headings, links, bullets and numbered lists inside it would show up as literal characters. 2. Every place, day, travel, check-in, check-out and to-do line starts at the first character of its line and has nothing extra on it. 3. Every place is a real, specific place written as name, city. Every airport is written as full airport name, country. 4. Times use the 24-hour clock with a colon, and only appear in front of a place. 5. Travel modes are only `walk`, `car`, `transit`, `train` or `plane`. 6. Both ends of every flight and every intercity train journey are in the same day. 7. Nothing uses syntax that is not on this page. There are no comments, durations, prices or tags: write those as notes. 8. If you are giving a link, it came out of code you ran, it starts with `https://routedoc.com/?trip=1`, and the code block is in your answer too. ## A complete example ```text Lisbon and Porto - 4 days in May Flights and both hotels are booked. Carry some cash for trams and pastry shops. >(walk) [x] Book flights [ ] Buy Lisbon to Porto train tickets [ ] Book Livraria Lello entry --- Day 1: Arrive in Lisbon 13:30 @(Lisbon Humberto Delgado Airport, Portugal) >(transit) Bags can be left at reception before check-in opens >(walk) 16:00 @(Praca do Comercio, Lisbon) 17:30 @(Lisbon Cathedral, Lisbon) 19:30 @(Time Out Market, Lisbon) Dinner here - arrive early, it fills up --- Day 2: Belem and Alfama 9:30 @(Hotel Avenida Palace, Lisbon) >(transit) 10:15 @(Jeronimos Monastery, Lisbon) [ ] Buy tickets online to skip the queue >(walk) 12:00 @(Pasteis de Belem, Lisbon) Custard tarts, best eaten warm 13:30 @(Belem Tower, Lisbon) >(transit) 17:00 @(Miradouro de Santa Luzia, Lisbon) Best light is an hour before sunset --- Day 3: Train to Porto >(car) 9:00 @(Santa Apolonia Station, Lisbon) >(train) 12:15 @(Campanha Station, Porto) >(transit) >(walk) 15:00 @(Livraria Lello, Porto) 17:00 @(Ponte Dom Luis I, Porto) Cross on the top deck for the view --- Day 4: Porto and fly home 10:00 @(Pestana Vintage Porto, Porto) 10:30 @(Sao Bento Station, Porto) The tiled entrance hall is the thing to see 12:00 @(Mercado do Bolhao, Porto) >(car) 16:00 @(Porto Francisco Sa Carneiro Airport, Portugal) >(plane) 19:30 @(London Heathrow Airport, United Kingdom) ``` What this example shows: - `>(walk)` in the header makes walking the default, so Day 4 needs no travel line until the taxi to the airport. - On Day 1, `>(walk)` is written once and covers every leg after it. - Days 2 and 4 start at the hotel, written as a place, so the first leg of the day is drawn. - The train to Porto and the flight home each have both ends inside one day. - Notes and to-dos sit directly under the place they are about. - Every place is written as name, city, and the three airports as airport name, country.