From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id kGMdF/DwAmPG/AAAbAwnHQ (envelope-from ) for ; Mon, 22 Aug 2022 04:58:56 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id wGEiFvDwAmMhVwEAG6o9tA (envelope-from ) for ; Mon, 22 Aug 2022 04:58:56 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id ECD1238F52 for ; Mon, 22 Aug 2022 04:58:55 +0200 (CEST) Received: from localhost ([::1]:48488 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oPxeQ-0000xL-HH for larch@yhetil.org; Sun, 21 Aug 2022 22:58:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oPxdu-0000tw-81 for emacs-orgmode@gnu.org; Sun, 21 Aug 2022 22:58:23 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:36632) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oPxds-0004oE-4f for emacs-orgmode@gnu.org; Sun, 21 Aug 2022 22:58:21 -0400 Received: by mail-pj1-x102a.google.com with SMTP id r14-20020a17090a4dce00b001faa76931beso12623523pjl.1 for ; Sun, 21 Aug 2022 19:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc; bh=31cVTYMg6UOMf2/CuDBPLhGOkQdtbS10ixGzcAq+zvs=; b=HwVp0Ypb67K+dMrpUSF0JHuibwU1ZkVkCayWldhKDIboxLL0RPEWVxQUpqKfHHGs0P KIeGgKbXBtNO+I40Id9oR5NLBC0aj2kdEbrgV8OuyvsTaN72rPMmoeWGAbtJlOhCT9gp uUQTBRKQMavOdRefh/U8fY9KTAdIvFO9TzFMpp8llIERnxK04VOEYLgNZV8arkc2ne7N qmbhZ7HZRA9Zq4edIq/FAqFR2IyblAIOSwJoW/g0rdFYdoSbjDwtSmsHnUdFFBRRV1bE xBIG1seFJBbgDBj+fdXdzN85E7AIIUINax610hl1HBMDYnSUkDCM3jsO1EhOjzhIl62R pcVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=31cVTYMg6UOMf2/CuDBPLhGOkQdtbS10ixGzcAq+zvs=; b=dFZo0I1OodQS8yVo8bjRHy5PT1Tqzpjgq1faPg13TzKDJlDeAjAv6Ih44G8QINASm/ 5H2q+XRD4PxmhpbxpPJmndaXd0AjSOw+djvUJBdr8WN1xwLS6n9efkFl2o7aa4uVeHVC S7UozqG57RpZwgj4V2F0EuZl5ORg7Ui7Mf+NSv4ApEPGNKsiV1F6cLDU0BqaKIbmqTy1 VimWcT5IAj2b3VqXMXfX6k3fR9kpux22OzwLgvtD9uc5LEhnZLMQQdethv1aj0P4sqb0 y+o9963pAnxRy+QxSJp5nz5Y3F1hn2fKMUbTK5YmpXKdID7Qb06xM2sEY1S1ifTmCRxl M4yA== X-Gm-Message-State: ACgBeo0XU/1+DJVvTJ29DZkZ6jhyaOTZIeYJ0pFbIF2trLE1Gp+Wu9LR kqQUVcSD1cFhZUNA4nBW+8ARyoCqizGITQ== X-Google-Smtp-Source: AA6agR4gRNez6yJ4WVPU3XTl8S5uw0nrvvUAzgzXNqePPTRBHHU7QDDC7QzSbV7M8qyXU7x6n6if+g== X-Received: by 2002:a17:902:76cb:b0:170:9f15:b9a1 with SMTP id j11-20020a17090276cb00b001709f15b9a1mr18167871plt.95.1661137097334; Sun, 21 Aug 2022 19:58:17 -0700 (PDT) Received: from localhost ([115.154.175.57]) by smtp.gmail.com with ESMTPSA id 2-20020a17090a0a8200b001fb08830742sm3073629pjw.44.2022.08.21.19.58.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Aug 2022 19:58:16 -0700 (PDT) From: Ihor Radchenko To: Rohit Patnaik Cc: emacs-orgmode@gnu.org Subject: Re: [Feature Request] Create an org-md-toplevel-hlevel variable to allow users to set the level of top level headings in markdown export In-Reply-To: References: <87zgfzmk15.fsf@localhost> Date: Mon, 22 Aug 2022 10:59:23 +0800 Message-ID: <875yilkmpg.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1661137136; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=31cVTYMg6UOMf2/CuDBPLhGOkQdtbS10ixGzcAq+zvs=; b=KkdwLUtdsWioYHqgNWLiY6rnWfVzZ9uJAydXHt6jXlQcCEgac6efRECb1LDkCJwJK2eob6 vFniBGgAclabtPYKpCXlymCrIU55lLHfLo7o3zOOucsy32W3OeVBI39B2IgK7Sr0yR/fmb +WhOsj7ipIjkcssWZ5cl+9ycTVxNlmJei6swCgi5IwQpDTZWtZuDgWXTUxf86UgDCCO/Rd TMVG41P0Qwcv1W7clYHA6N+s0leXP2VxobPsXBEFoe+muMumIMxES8xseL0OSGsnAHYgzv gd3324b/77LO2AxCDUCGIhF+NlwPk8jO7SqiJbAqDhiOFao+89Fke4V+7yVGSg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1661137136; a=rsa-sha256; cv=none; b=VokQ+fXwyCtqEswaZkeugdqMyJ3xci+u6dl36U1xfH1sOgdHTo4nqQ/7sVPhWS3Q7BKyQl SGONrEZ03ONElDbIerB86qTRU6uxGO0HAPhIortCx6M7td2rT1gxUVn6f8WqBqgNo6ZY/e Z+XOnKbajTHV5QHG/w+pB5MkxViXFLJIQtDtCatTrGjhRY9dxtXuxZtyPhjZ0SrXvWWpC2 O3NuvCVp5EStNCc1pnrSNw45pgoc5AjWj+Gh14fNX0MnT3M/2whKcnnpj4gDAxOQ5gJ7Y5 JepxWgA65W50QD8k/Y+m1+vbw45Z1CCXKeEO18B2ywa795QFJMrRfqJsyg101A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HwVp0Ypb; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.92 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HwVp0Ypb; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: ECD1238F52 X-Spam-Score: -3.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: /npkeiLoE2fS "Rohit Patnaik" writes: >> This contribution will be welcome. > > I've attached a patch which implements the change. I followed the pattern that > ox-html uses to the greatest extent possible. I tested it by exporting org-mode > files to markdown with the table of contents both enabled and disabled. I > didn't see any errors, and I was able to make the top level heading a level 2 > (or even level 3) heading rather than level 1. Thanks for your contribution! Please also add the NEWS entry and an item to "14.1.5 Options for the exporters" section of the manual. > Subject: [PATCH] Added top level header setting for md export > > This commit adds a customization, org-md-toplevel-hlevel, which sets the > heading level of top-level headings in the exported markdown. This makes > markdown export behave more like HTML export, which reads > org-html-toplevel-hlevel to decide what the top level heading for HTML > export should be. Please follow the changelog style as described in https://orgmode.org/worg/org-contribute.html#commit-messages > +(defcustom org-md-toplevel-hlevel 1 > + "The markdown heading level to use for level 1 headings in markdown export. > +If this is 1, the top level headings will be level 1 markdown headings. If this > +is 2, then top level headings will be level 2 markdown headings. By default > +this is 1, so that org-mode headings correspond to the same level markdown > +headings. Incrementing this value may be helpful creating markdown for > +inclusion in another document or application that reserves top-level headings > +for its own use." > + :group 'org-export-md > + :type 'string) Please follow the recommended documentation style: double space between sentences, 80 chars fill. See "D.6 Tips for Documentation Strings" section of Elisp manual. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92