From 2980fe3c905fc76f325ccf830abc2f03d8a4ad43 Mon Sep 17 00:00:00 2001 From: "M. Taylor Saotome-Westlake" Date: Mon, 19 Feb 2018 19:42:52 -0800 Subject: [PATCH] not thinking in nested parentheticals vs. installing a footnote plugin If I don't know how to make my thinking more linear and less tree-like, I might as well shove some of the subtrees into footnotes for legibility. I continue to by disappointed by the abysmal quality of the Pelican plugin/theme ecosystem, and very happy that I chose Pelican. (What I don't like, I can fix! Because Python! Rah!) --- ...s-were-made-for-man-to-make-predictions.md | 18 ++- pelicanconf.py | 2 +- plugins/simple_footnotes.py | 105 ++++++++++++++++++ requirements.txt | 1 + theme/static/css/main.css | 11 ++ 5 files changed, 126 insertions(+), 11 deletions(-) create mode 100644 plugins/simple_footnotes.py diff --git a/content/drafts/the-categories-were-made-for-man-to-make-predictions.md b/content/drafts/the-categories-were-made-for-man-to-make-predictions.md index 1dbc0f3..bf468d6 100644 --- a/content/drafts/the-categories-were-made-for-man-to-make-predictions.md +++ b/content/drafts/the-categories-were-made-for-man-to-make-predictions.md @@ -72,19 +72,17 @@ Of course, the phrasing _If gender dysphoria is caused by ..._ implies that we'r Analogously, in medicine, many different pathogens can cause the same symptoms (_e.g._, sneezing, or fever), but doctors care about distinguishing different illnesses by etiology, not just symptoms, because distinct physical mechanisms can give rise to distinct treatment decisions, if not immediately, then at least in principle. (For example, a bacterial illness will respond to antibiotics, but a viral one won't—or today's treatments might be equally effective against two different species of bacteria, but future drugs might work better on one or the other.) -_As it happens_, (I claim that) the evidence that gender dysphoria comprises more than one etiologically distinct condition is quite strong. For the rest of this post, I'm going to focus on the male-to-female case for reasons of personal interest (see many other [posts](/2017/Feb/a-beacon-through-the-darkness-or-getting-it-right-the-first-time/) [on](/2017/Jan/the-erotic-target-location-gift/) [this](/2017/Dec/a-common-misunderstanding-or-the-spirit-of-the-staircase-24-january-2009/) [blog](/2016/Nov/chromatic-key/)), quality of available research (the etiology of trans men is less well-researched and the [distribution may be changing](http://www.slate.com/blogs/outward/2017/09/13/trans_youth_clinics_are_seeing_more_trans_boys_than_before_why.html)), and societal impact (which I would claim is asymmetric between MtF and FtM for several reasons). An analysis of the female-to-male situation would be similar in many respects but different in others, and is left to the interested reader. +_As it happens_, (I claim that) the evidence that gender dysphoria comprises more than one etiologically distinct condition is quite strong. For the rest of this post, I'm going to focus on the male-to-female case for reasons of personal interest[ref]See many other [posts](/2017/Feb/a-beacon-through-the-darkness-or-getting-it-right-the-first-time/) [on](/2017/Jan/the-erotic-target-location-gift/) [this](/2017/Dec/a-common-misunderstanding-or-the-spirit-of-the-staircase-24-january-2009/) [blog](/2016/Nov/chromatic-key/).[/ref], quality of available research [ref]The etiology of trans men is less well-researched than that of trans women—and the [distribution may be changing](http://www.slate.com/blogs/outward/2017/09/13/trans_youth_clinics_are_seeing_more_trans_boys_than_before_why.html).[/ref], and societal impact [ref]Which I would claim is asymmetric between MtF and FtM for several reasons.[/ref]. An analysis of the female-to-male situation would be similar in many respects but different in others, and is left to the interested reader. -A minority of male-to-female transsexuals exhibit lifelong sex-atypical behavior and interests, are attracted to men (note: female-typical sexual orientation), and transition early in life (typically no later than their early twenties). Essentially, these are physiological males whose psychology is so far outside of the male normal range along so many dimensions that they find themselves more comfortable and socially successful living as women rather than as extremely effeminate gay men. This likely _is_ a brain-intersex condition: [along with non-gender-dysphoric gay men](https://en.wikipedia.org/wiki/Fraternal_birth_order_and_male_sexual_orientation), they [have a statistical preponderance of older brothers](https://link.springer.com/article/10.1007%2Fs10508-011-9777-6) which is [theorized to be due to the mother's immune system response to male fetuses affecting the development of later pregnancies](http://www.pnas.org/content/115/2/302). +A minority of male-to-female transsexuals exhibit lifelong sex-atypical behavior and interests, are attracted to men[ref]_N.b._, the typical female sexual orientation[/ref], and transition early in life (typically no later than their early twenties). Essentially, these are physiological males whose psychology is so far outside of the male normal range along so many dimensions that they find themselves more comfortable and socially successful living as women rather than as extremely effeminate gay men. This likely _is_ a brain-intersex condition: [along with non-gender-dysphoric gay men](https://en.wikipedia.org/wiki/Fraternal_birth_order_and_male_sexual_orientation), they [have a statistical preponderance of older brothers](https://link.springer.com/article/10.1007%2Fs10508-011-9777-6) which is [theorized to be due to the mother's immune system response to male fetuses affecting the development of later pregnancies](http://www.pnas.org/content/115/2/302). -However, the majority of male-to-female trans people in Western countries do not fit this profile. They are attracted to women or are bisexual and, while reporting a desire to be female dating back to puberty or earlier in childhood, they don't exhibit an _unusual_ number of female-typical traits compared to other males. In contrast to the "early-onset", androphilic type, who couldn't fit in to the world as men if they tried, this second group of "late-onset", non-exclusively-androphilic gender-dysphoric males _can_ function socially as men; we just—aspire to a higher form of existence. (I think I'm justified in counting myself in this taxon even though I'm [choosing not to transition](/2017/Sep/hormones-day-156-developments-doubts-and-pulling-the-plug-or-putting-the-cis-in-decision/).) The covertness of late-onset gender dysphoria explains why someone like [Caitlyn Jenner](https://en.wikipedia.org/wiki/Caitlyn_Jenner) can have a long, successful public existence as a man—winning men's decathalons, racing sports cars, marrying women and fathering children—before eventually deciding to transition at age 65. +However, the majority of male-to-female trans people in Western countries do not fit this profile. They are attracted to women or are bisexual and, while reporting a desire to be female dating back to puberty or earlier in childhood, they don't exhibit an _unusual_ number of female-typical traits compared to other males. In contrast to the "early-onset", androphilic type, who couldn't fit in to the world as men if they tried, this second group of "late-onset", non-exclusively-androphilic gender-dysphoric males _can_ function socially as men; we[ref]I think I'm justified in counting myself in this taxon even though I'm [choosing not to transition](/2017/Sep/hormones-day-156-developments-doubts-and-pulling-the-plug-or-putting-the-cis-in-decision/).[/ref] just—aspire to a higher form of existence. The covertness of late-onset gender dysphoria explains why someone like [Caitlyn Jenner](https://en.wikipedia.org/wiki/Caitlyn_Jenner) can have a long, successful public existence as a man—winning men's decathalons, racing sports cars, marrying women and fathering children—before eventually deciding to transition at age 65. This proposed two-type taxonomy of trans women is very controversial, probably in large part because it's part of a theory that claims that the late-onset type is rooted in an unusual sexual interest termed _autogynephilia_ ("love of oneself as a woman"). Anne Lawrence, herself a self-identified autogynephilic transsexual, iconically describes autogynephiles as ["men who love women and want to become what they love."](http://annelawrence.com/becoming_what_we_love.pdf) A review of the empirical evidence for the two-type taxonomy is beyond the scope of this post. To interested or skeptical readers who only have time to read one paper, I recommend Lawrence's ["Autogynephilia and the Typology of Male-to-Female Transsexualism: Concepts and Controversies"](http://unremediatedgender.space/papers/lawrence-agp_and_typology.pdf); for a more exhaustive treatment, see the first two chapters of Lawrence's monograph [_Men Trapped in Men's Bodies_](https://surveyanon.files.wordpress.com/2017/07/men-trapped-in-mens-bodies_book.pdf) or follow the links and citations in [Kay Brown's FAQ](https://sillyolme.wordpress.com/faq-on-the-science/). -To avoid the main ideas of this post getting mired in _unnecessary_ controversy, I'd like to emphasize that it's possible to reject the hypothesis that autogynephilia is the _cause_ of the second type, while [still agreeing that](https://thingofthings.wordpress.com/2017/04/18/against-blanchardianism/) there observationally seem to be _at least_ two types of trans women, with the late-onset/non-exclusively-androphilic type or types being less overtly feminine and not sharing the etiology of the early-onset/androphilic type. Between the statistical signal in the psychology literature (I again defer to [Brown's review](https://sillyolme.wordpress.com/faq-on-the-science/)), and studying the public biographies of trans women (the life-arcs of people like Jenner or [the Wachowski sisters](https://en.wikipedia.org/wiki/The_Wachowskis) seem noticeably different from those of people like [Janet Mock](https://en.wikipedia.org/wiki/Janet_Mock) or [Laverne Cox](https://en.wikipedia.org/wiki/Laverne_Cox)), I think this should be hard to dispute. - -(To be clear, I _do_ think autogynephilia has a causal role in the late-onset type, but again, we can leave that to other posts.) +To avoid the main ideas of this post getting mired in _unnecessary_ controversy, I'd like to emphasize that it's possible to reject the hypothesis that autogynephilia is the _cause_ of the second type, while [still agreeing that](https://thingofthings.wordpress.com/2017/04/18/against-blanchardianism/) there observationally seem to be _at least_ two types of trans women, with the late-onset/non-exclusively-androphilic type or types being less overtly feminine and not sharing the etiology of the early-onset/androphilic type.[ref]To be clear, I _do_ think autogynephilia has a causal role in late-onset gender dysphoria in males, but that can be left to other posts; arguments can only be strengthened by leaving out [burdensome details](http://lesswrong.com/lw/jk/burdensome_details/).[/ref] Between the statistical signal in the psychology literature (I again defer to [Brown's review](https://sillyolme.wordpress.com/faq-on-the-science/)), and studying the public biographies of trans women (the life-arcs of people like Jenner or [the Wachowski sisters](https://en.wikipedia.org/wiki/The_Wachowskis) seem noticeably different from those of people like [Janet Mock](https://en.wikipedia.org/wiki/Janet_Mock) or [Laverne Cox](https://en.wikipedia.org/wiki/Laverne_Cox)), I think this should be hard to dispute. We _are_, however, supposing that the late-onset type or types is either not an intersex condition, or at _most_, a very mild one: we could perhaps imagine a gender identity "switch" in the brain that can get flipped around (explaining the eventual need to transition) without much affecting other sexually-dimorphic parts of the brain (explaining how transition could be delayed so long, and come as such a surprise to others). @@ -92,7 +90,7 @@ This hypothesis is weaker than the autogynephilia theory, but still has implicat To this it might be objected that there are many different types of women. Clusters can internally have many subclusters: Pureto Rican women (or married women, or young women, or lesbians, _&c_.) don't have the _same_ distribution of traits as women as a whole, and yet are still women. Why should "trans" be different from any other adjective one might use to specify a subcategory of women? -What makes this difficult is that—supposing the two-types hypothesis is true and gender dysphoria in non-exclusively-androphilic biological males is mostly not an intersex condition—most trans women aren't just not part of the female cluster in configuration space, displaced from its center in some arbitrary direction. They're specifically part of _male_ cluster along many or most dimensions, which people _already_ have a concept for. +What makes this difficult is that—supposing the two-types hypothesis is true and gender dysphoria in non-exclusively-androphilic biological males is mostly not an intersex condition—most trans women aren't just not part of the female cluster in configuration space, displaced from its center in some arbitrary direction. They're specifically part of _male_ cluster along most dimensions, which people _already_ have a concept for. genderspace cluster choice @@ -132,11 +130,11 @@ But this isn't how _anyone_ actually thinks about gender! If you need a sticker to get people to gender you correctly, _your transition has failed_. -In a free Society, everyone should have the right to express themselves, to modify their body and social presentation however they see fit. But having your best to present your true self, you can't—not even _shouldn't_, but _can't_—exert detailed control how other people percieve you. +In a free Society, everyone should have the right to express themselves, to modify their body and social presentation however they see fit. But having your best to present your true self, you can't—not even _shouldn't_, but _can't_—exert detailed control how other people perceive you. All you can do is incentivize them to lie. -And when the laudable instinct to be kind gets corrupted into [universal socially-mandatory lies](http://slatestarcodex.com/2017/10/23/kolmogorov-complicity-and-the-parable-of-lightning/)—when a man can where a sticker that says "SHE" and say, "Who are you going to believe, my sticker, or your lying eyes? There's no rule of rationality saying that you shouldn't believe the sticker, and there are plenty of rules of human decency saying that you should" and the _finest minds of my generation_ can permit themselves no other response than, "She's absolutely correct; the categories were made for man, not man for the categories." +And when the laudable instinct to be kind gets corrupted into [universal socially-mandatory lies](http://slatestarcodex.com/2017/10/23/kolmogorov-complicity-and-the-parable-of-lightning/)—when a man can wear a sticker that says "SHE" and say, "Who are you going to believe, my sticker, or your lying eyes? There's no rule of rationality saying that you shouldn't believe the sticker, and there are plenty of rules of human decency saying that you should" and the _finest minds of my generation_ can permit themselves no other response than, "She's absolutely correct; the categories were made for man, not man for the categories." This is not rationality. This isn't even kindness. We're _smarter_ than this. @@ -174,7 +172,7 @@ A beat. "Um, sorry," you say. -He buries his head in his arms and begins to cry—long, shuddering sobs for his lost empire. Worse that lost—an empire that never existed, except in the charitable facade of people who valued him as a local in-joke, but not as a man. +He buries his head in his arms and begins to cry—long, shuddering sobs for his lost empire. Worse than lost—an empire that never existed, except in the charitable facade of people who valued him as a local in-joke, but not as a man. You wait many minutes for him to calm down. diff --git a/pelicanconf.py b/pelicanconf.py index 9fbf74a..c35c598 100644 --- a/pelicanconf.py +++ b/pelicanconf.py @@ -64,7 +64,7 @@ PAGINATION_PATTERNS = ( THEME = 'theme' PLUGIN_PATHS = ["plugins"] -PLUGINS = ["tag_cloud"] +PLUGINS = ["tag_cloud", "simple_footnotes"] TAG_CLOUD_STEPS = 6 TAG_CLOUD_SORTING = "alphabetically" diff --git a/plugins/simple_footnotes.py b/plugins/simple_footnotes.py new file mode 100644 index 0000000..890cb1b --- /dev/null +++ b/plugins/simple_footnotes.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- # + +# copied from getpelican/pelican-plugins@f15f42c6dba9 + +# with edits to add an
and "Notes" header + +from pelican import signals +import html5lib +import six + +RAW_FOOTNOTE_CONTAINERS = ["code"] + + +def getText(node, recursive=False): + """Get all the text associated with this node. + With recursive == True, all text from child nodes is retrieved.""" + L = [u''] + for n in node.childNodes: + if n.nodeType in (node.TEXT_NODE, node.CDATA_SECTION_NODE): + L.append(n.data) + else: + if not recursive: + return None + L.append(getText(n)) + return u''.join(L) + + +def sequence_gen(genlist): + for gen in genlist: + for elem in gen: + yield elem + + +def parse_for_footnotes(article_or_page_generator): + all_content = [ + getattr(article_or_page_generator, attr, None) \ + for attr in [u'articles', u'drafts', u'pages']] + all_content = [x for x in all_content if x is not None] + for article in sequence_gen(all_content): + if u"[ref]" in article._content and u"[/ref]" in article._content: + content = article._content.replace(u"[ref]", u"").replace(u"[/ref]", + u"") + parser = html5lib.HTMLParser(tree=html5lib.getTreeBuilder(u"dom")) + dom = parser.parse(content) + endnotes = [] + count = 0 + for footnote in dom.getElementsByTagName(u"x-simple-footnote"): + pn = footnote + leavealone = False + while pn: + if pn.nodeName in RAW_FOOTNOTE_CONTAINERS: + leavealone = True + break + pn = pn.parentNode + if leavealone: + continue + count += 1 + fnid = u"sf-%s-%s" % (article.slug, count) + fnbackid = u"%s-back" % (fnid,) + endnotes.append((footnote, fnid, fnbackid)) + number = dom.createElement(u"sup") + number.setAttribute(u"id", fnbackid) + numbera = dom.createElement(u"a") + numbera.setAttribute(u"href", u"#%s" % fnid) + numbera.setAttribute(u"class", u"simple-footnote") + numbera.appendChild(dom.createTextNode(six.text_type(count))) + txt = getText(footnote, recursive=True).replace(u"\n", u" ") + numbera.setAttribute(u"title", txt) + number.appendChild(numbera) + footnote.parentNode.insertBefore(number, footnote) + if endnotes: + ol = dom.createElement(u"ol") + ol.setAttribute(u"class", u"simple-footnotes") + for e, fnid, fnbackid in endnotes: + li = dom.createElement(u"li") + li.setAttribute(u"id", fnid) + while e.firstChild: + li.appendChild(e.firstChild) + backlink = dom.createElement(u"a") + backlink.setAttribute(u"href", u"#%s" % fnbackid) + backlink.setAttribute(u"class", u"simple-footnote-back") + backlink.appendChild(dom.createTextNode(u'\u21a9')) + li.appendChild(dom.createTextNode(u" ")) + li.appendChild(backlink) + ol.appendChild(li) + e.parentNode.removeChild(e) + body = dom.getElementsByTagName(u"body")[0] + body.appendChild(dom.createElement("hr")) + notes_header = dom.createElement("p") + notes_header.setAttribute("id", "notes-header") + notes_header.appendChild(dom.createTextNode("Notes")) + body.appendChild(notes_header) + body.appendChild(ol) + s = html5lib.serializer.HTMLSerializer(omit_optional_tags=False, quote_attr_values='legacy') + output_generator = s.serialize( + html5lib.treewalkers.getTreeWalker(u"dom")(dom.getElementsByTagName(u"body")[0])) + article._content = u"".join(list(output_generator)).replace( + u"", u"[ref]").replace(u"", u"[/ref]").replace( + u"", u"").replace(u"", u"") + + +def register(): + signals.article_generator_finalized.connect(parse_for_footnotes) + signals.page_generator_finalized.connect(parse_for_footnotes) diff --git a/requirements.txt b/requirements.txt index ac0473a..847c5df 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ blinker==1.4 docutils==0.14 feedgenerator==1.9 +html5lib==1.0.1 Jinja2==2.9.6 Markdown==2.6.9 MarkupSafe==1.0 diff --git a/theme/static/css/main.css b/theme/static/css/main.css index 1fae233..a32ebdb 100644 --- a/theme/static/css/main.css +++ b/theme/static/css/main.css @@ -227,6 +227,7 @@ ol.archive li .tags } + /* Social */ .social { @@ -324,3 +325,13 @@ span.tag-5 { span.tag-6 { font-size: 75%; } + + +/* footnotes */ +p#notes-header { + font-weight: bold; +} + +ol.simple-footnotes { + font-size: 85%; +} -- 2.17.1