Okay/Sketchbook
Jump to navigation
Jump to search

Multiple days in a row now I have woken up in a cold sweat having dreamt new Okay markup. I'm writing it here so I can gather feedback and iterate before specifying. I think this is what normal spec writers do already.
Room Directory
Initial Concept
<main class="ok-rooms">
<h1>Rooms</h1>
<p>Here are all the rooms on this server.</p>
<ul>
<li><a rel="ok-room" href="/rooms/room-1">Room 1</a></li>
<li><a rel="ok-room" href="/rooms/room-2">Room 2</a></li>
</ul>
<section>
<h2>Cooler Rooms</h2>
<ul>
<li><a rel="ok-room" href="/rooms/room-3">Room 3</a></li>
<li><a rel="ok-room" href="/rooms/room-4">Room 4</a></li>
</ul>
</section>
</main>
Thoughts:
- To what extent do we want to enforce structure? Right now the only things I would say are significant to the client are the links and sections. Everything else is window dressing for browsers.
- Do we really need the outer ok-rooms element?
- Should ok-room be a rel or a class
- Is the section syntax silly
- Do we want to require them to be in a list element.
- In that case, what happens if you put another list INSIDE a list ?????????!!!?
- I had a thought that it would be fun for clients to just load the room directory page inside a little window or something and then when you click one of the rooms it opens it in the client's own interface. You could probably do this as a browser extension actually.
Pagination
<div class="ok-messages">
<a href="/room/1/page/2" rel="prev">Previous</a>
<!-- messages here -->
<a href="/room/1/page/4" rel="next">Next</a>
</div>
This is kind of nice because
- It doesn't really require any effort from the client. It's basically just a linked list.
- If there isn't a next page you can just omit it from the output. very HATEOAS
- This is already used by many sites for pagination, so search engines etc understand it.
Thoughts:
- What happens when you want to find a specific message
- Do we want to require each page have an immutable address (I think yes, for caching and so on (Ok but then what do we do about deleted messages))
- What direction do the pages go in. Does the first page have the latest message or the first message. Mulch to consider
- Okay so I think when you request the room url without specifying a page it should redirect you to the last page (so the page containing the latest message) and then you can continually fetch the previous page to get the backlog. That makes sense i think.