Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ‘·β€β™€οΈ Add Build Process for Definitions #31

Merged
merged 65 commits into from
Dec 16, 2019
Merged

πŸ‘·β€β™€οΈ Add Build Process for Definitions #31

merged 65 commits into from
Dec 16, 2019

Conversation

ovlb
Copy link
Collaborator

@ovlb ovlb commented Nov 12, 2019

Hi!

First of all: This is not done yet. But I would rather get some feedback now, or at least hints if the direction can work out. :)

This is also does not yet handle multiple definitions as proposed by @good-idea in https://github.com/tatianamac/selfdefined/issues/13#issuecomment-548979863.

It is basically a compromise of being human editable, but machine parsable. With a better automated editing process we will probably get closer to not-human-editable. One learning so far: Dictionaries are very hard to do right.

I added Eleventy and this is nice. Definitions (for now just some test cases) live in 11ty/definitions. We can add one .md file per word, put in some front matter (e.g. for title, flags and alt-words) and write the definition itself in Markdown. This is not fully specced out and especially the rendering/applying the existing styles needs more work.

I have done some updates to the markup here and there (e.g. the alt words are now a list to make more sense for assistive technology).

You can test this by running npm install in the project root and npm run watch afterwards.
There is no real dev server yet. CodeKit should work, but as this is not a resource everyone can afford, there needs to be some more work done on that side.

Also, if we would get one dollar for every instance of me failing to write Β«definitionΒ» the project would have a very solid financial standing now. πŸ™ˆ

To-Do

  • Finalise parsing of defined items (flags, definition content)
  • Make it possible to have child items in the table of content (probably through front matter objects)
  • Accessibly handle Emojis in titles and definitions
  • Split ToC in groups
  • show items starting with - in the appropriate alphabetical place
  • Port all the definitions (some sub terms missing)
  • Write documentation for definition file structure (in progress)
  • Dev Server
  • Build process for (S)CSS
  • Production build for everything

@tatianamac
Copy link
Collaborator

This is so lovely, @ovlb ! I appreciate all you've done so much. 😭
I've included a few initial thoughts below, but if there's something specific you want feedback on, please let me know.

Generally speaking, the structure so far seems intuitive and really helpful. I can see how to evolve it. Now that I'm writing more definitions, I can see more use cases and needs.

1️⃣ I believe based on how you write it we can add basically infinite headers to create the needed sections. I have ideas as to how I want different types of definition types to be structured. Maybe we could set a few template types for words?

2️⃣ Can alt-words be linked from FML in some sort of automated way? For example, can we somehow run a script to see if any of the alt words is present in the dictionary, and if so, automatically link it?

3️⃣ I'd like to be able to match the styling a bit more closely to the page, but this is a less critical thing to influence later.

I'd also love @zachleat to weigh in about this general approach, and share if there are any other ways we could use Eleventy intelligently.

@ovlb
Copy link
Collaborator Author

ovlb commented Nov 13, 2019

Hey Tatiana,

Glad to hear that you can work with and understand the updated structure.

1️⃣: Yes, correct. Currently, you could go free form with the definitions. Adding example files which outside contributors can copy to write their own definitions is on my to-do list. I would maybe add a folder where these examples can live? We can link to that folder from a contributing.md to make them discoverable.

2️⃣: This should definitely be possible in the build step or through a template filter. I’ll have a look later.

3️⃣: Working on it. :)

OMG, you tagged Zach. I will hide under the rug for now. 😜

With warmth,
Oscar

@ovlb
Copy link
Collaborator Author

ovlb commented Nov 14, 2019

@tatianamac I’ve added a filter to link to defined alt words (added unreal.md to test it in the list of crazy).

Also, the styles match the original better. Still, way to go, but getting there :) As the styles now rely on a bunch of sibling selector trickery and display: grid I currently can’t rebuild the grey line separating sub-headlines and adjacent content if there is more than one paragraph in the content. πŸ˜”

Copy link

@zachleat zachleat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! My only high level piece of feedback is that you might be able to use one collection for definitions and definedWords somehow? You may even be able to get away with removed the defined key in each word front matter and tying that to word.templateContent.trim().length instead? Just one less thing to keep in sync manually

.eleventy.js Outdated Show resolved Hide resolved
.eleventy.js Outdated Show resolved Hide resolved
.eleventy.js Outdated Show resolved Hide resolved
@zachleat
Copy link

Oh one more thing based on your comments I just want to make sure you’re aware of eleventy --serve, which is a hot-reloading version of --watch

@ovlb
Copy link
Collaborator Author

ovlb commented Nov 15, 2019

@zachleat Thanks so much for your kind feedback :)

re one collection: I tried that, but the template was complaining about me trying to filter at one point. That’s why I went with two separate collections. In hindsight, it also makes the linkIfExistsInCollection filter easier to grasp. Though I would lie if I say this is part of the initial reasoning. It was me being lazy.

re checking for template content: That’s a nice hint! Upside I see with the defined toggle is that we would have an easy way to hide definitions that become outdated or disputed without deleting files/content permanently. I would like to have @tatianamac’s opinion here.

And I totally missed --serve. Tak! πŸ™ˆ

O*

@ovlb
Copy link
Collaborator Author

ovlb commented Nov 18, 2019

@tatianamac The docs are very much work in progress. As a matter of fact, I wanted to discuss proper examples with you. I just started writing and maybe got a bit overenthusiastic.

Thanks to the power of document.querySelectorAll() I’ve ported all definitions. Yay. Just need to add flags and sub-terms. This and the build process and I am done, I guess. I would take the emoji handling into another PR, as it is not strictly related.

@ovlb
Copy link
Collaborator Author

ovlb commented Nov 18, 2019

I somehow have a hand for PRs that escalate quite quickly. πŸ™ˆ

Screenshot 2019-11-19 at 00 20 58

@ovlb
Copy link
Collaborator Author

ovlb commented Nov 19, 2019

@tatianamac Data Processing is done πŸ€–

@tatianamac
Copy link
Collaborator

@ovlb Can we consider this PR closed (asbuild process for definitions is the core task here)?

I'd ideally like to open a few new issues of things you ambitiously included on your to-do list (and got amazingly far onβ€”thank you!).

  • Build out contributing.md
  • Enhance emoji support
    ... Am I missing anything else?

@ovlb
Copy link
Collaborator Author

ovlb commented Nov 20, 2019

@tatianamac Yes, almost. I would like to add the build process so that the Netlify deploy works seamlessly. I will do it this evening. The other open items can be handled in separate Issues/PRs. I will split it iup, after adding the build config.

@tatianamac
Copy link
Collaborator

You're so helpful and wonderful! Thank you! πŸ™πŸ½

@ovlb
Copy link
Collaborator Author

ovlb commented Nov 22, 2019

@tatianamac You are too kind. Glad I can help with this project.

Build config is now existing, Netlify works. I think you can merge this. πŸ‘©β€πŸš€

@ovlb ovlb changed the title WIP: πŸ‘·β€β™€οΈ Add Build Process for Definitions πŸ‘·β€β™€οΈ Add Build Process for Definitions Nov 22, 2019
@ovlb ovlb mentioned this pull request Nov 22, 2019
3 tasks
@tatianamac tatianamac merged commit 1dd1027 into selfdefined:master Dec 16, 2019
@ovlb ovlb deleted the feature/eleventy-build branch January 10, 2020 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants