Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/_data/meetups/armenia.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
region: Asia
country: Armenia
meetup_alt: https://t.me/technicalwritersEVN
organizers:
- name: Ani Asatryan
link: https://www.linkedin.com/in/ani-asatryan-85565b196/
- name: Note, the Armenia Write the Docs group uses Telegram for their events and community.
3 changes: 1 addition & 2 deletions docs/_data/meetups/ger-hamburg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ country: Germany
city: Hamburg
website: https://www.meetup.com/write-the-docs-hamburg/events/
meetup: Write-the-Docs-Hamburg
organizer:
organizers:
- name: Frank Ralf
link:
2 changes: 1 addition & 1 deletion docs/_data/meetups/irl-dublin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ website: https://www.meetup.com/write-the-docs-ireland/events/
meetup: Write-The-Docs-Ireland
organizers:
- name: Artem Konev
- link: https://www.linkedin.com/in/artemkonev
link: https://www.linkedin.com/in/artemkonev
1 change: 0 additions & 1 deletion docs/_data/meetups/qrm-usEast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ state: East Coast
city:
website: https://www.meetup.com/virtual-write-the-docs-east-coast-quorum/events/
meetup: Virtual-Write-The-Docs-East-Coast-Quorum
twitter:
organizers:
- name: Rose Williams
link: https://twitter.com/ZelWms
2 changes: 1 addition & 1 deletion docs/_data/meetups/usa-sanfrancisco.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ state: California
city: San Francisco
website: https://www.meetup.com/write-the-docs-bay-area/events/
meetup: Write-the-Docs
organizer:
organizers:
- name: Ilona Koren-Deutsch
link: https://twitter.com/nitsekees
15 changes: 15 additions & 0 deletions docs/_data/schema-meetups.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
region: str(required=True)
country: str(required=True)
state: str(required=False)
city: str(required=False)
website: str(required=False)
twitter: str(required=False)
meetup: str(required=False) # I can't figure out how to validate must contain either meetup or meetup_alt
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't think there is a way to do this in the schema

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it feels like there should be.

We could refactor to something like:

source:
   # one of
   meetupcom: example
   linkedin: example
   other: example

and then I believe we could something along these lines https://github.com/23andMe/Yamale?tab=readme-ov-file#lists

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, I've gone a ahead and done that, and it seems to work, thought it still breaks my brain a little.

meetup_alt: str(required=False)
organizers: list(include('organizer-detail'), min=1, max=9)

---

organizer-detail:
name: str(required=True)
link: str(required=False, none=False)
3 changes: 2 additions & 1 deletion docs/_ext/meetups.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ def load_meetups_by_region():
'organizers',
'website',
'twitter',
'meetup_alt',
]])
if 'meetup' not in meetup:
if 'meetup' not in meetup and 'meetup_alt' not in meetup:
raise ExtensionError('Meetup missing `meetup` key: file={0}'.format(
yaml_file
))
Expand Down
7 changes: 7 additions & 0 deletions docs/_scripts/validate-yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,11 @@ do
yamale -s docs/_data/schema-sessions.yaml $y -p ruamel
done

# Meetups

for y in ../_data/meetups/*.yaml
do
yamale -s docs/_data/schema-meetups.yaml $y -p ruamel
done

cd -
5 changes: 3 additions & 2 deletions docs/_templates/include/meetups/listing.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
<dl class="meetup-listing">
{% for meetup in meetups %}
<dt class="meetup-listing-detail">

<a href="{% if meetup['page'] %}{{ meetup['page'] }}{% else %}http://www.meetup.com/{{ meetup['meetup'] }}/{% endif %}">
<a href="{% if meetup['page'] %}{{ meetup['page'] }}
{% elif meetup['meetup_alt'] %}{{ meetup['meetup_alt'] }}
{% else %}http://www.meetup.com/{{ meetup['meetup'] }}/{% endif %}">
{% if meetup['city'] %}{{ meetup['city'] }}, {% endif -%}
{% if meetup['state'] %}{{ meetup|state_abbr }}, {% endif -%}
{{ meetup['country'] -}}
Expand Down