From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.text.pandoc/30736 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John MacFarlane Newsgroups: gmane.text.pandoc Subject: Re: Feature Idea: docx -> HTML table styling Date: Wed, 15 Jun 2022 16:36:11 -0600 Message-ID: References: Reply-To: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4565"; mail-complaints-to="usenet@ciao.gmane.io" To: Noah Malmed , pandoc-discuss Original-X-From: pandoc-discuss+bncBCJZJHG45QDBBYF5VGKQMGQE7DIQMVA-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Thu Jun 16 00:36:19 2022 Return-path: Envelope-to: gtp-pandoc-discuss@m.gmane-mx.org Original-Received: from mail-oa1-f58.google.com ([209.85.160.58]) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o1bcZ-000126-9h for gtp-pandoc-discuss@m.gmane-mx.org; Thu, 16 Jun 2022 00:36:19 +0200 Original-Received: by mail-oa1-f58.google.com with SMTP id 586e51a60fabf-f2db7440d8sf9690014fac.9 for ; Wed, 15 Jun 2022 15:36:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1655332578; cv=pass; d=google.com; s=arc-20160816; b=GvdVlX5PxTmFAwHWryi3/KsS9QcPI9JuKv8GeBlNrCstA8Z6Qd3Uk4g8VFL5Uh6wcI xF+M+n9NAPivS0GwUh9o/wVyH6wv1i8BfdcOyEvfNEsQFVdvUz310myevwn0ryT+Z9T/ bItjhMtNo2MfOFi65tnoMfvG6AostTYOaCDjJs+f2FIZX/QM3ymkdRoEiJk2ytpkuyQc KIdvMvY2o64f1iXh/cnZkpLaV3lfivy4T6GNJyeHHAgILGHyfX1vHZa855fQx2SephrV Uhyp+t804DoJAnsc872IONeI2fBv/cmVm266fMqagAHFF6vbQK/W5nUURfqTpOauvKpm N3Tg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:mime-version:message-id :date:references:in-reply-to:subject:to:from:sender:dkim-signature; bh=+K3p3Q3Adp9+DbUGh4xM7SIZgwCwfCjzicZKm2RDqHA=; b=iA+VMRjE1RQOQKXLW2QvlTXVHiyzCK4Uhal3hH8k34LhSIqkYsPU+c1Di5zZzRpIa0 enrzsqK49RlWCBEFDAepd7w+LD0S/ieMMYQjyumRUXCNymVJs+YE5Kjdy+KbmAe6OG71 9l6QFdUu+1XyNioZ9gk80Ujs7jS9dDBWUtN0hgGdU7XGxZXpzcpCvFBPcOwWtri1c2SR QsYJcsqN5mgifAzyLXLFDYVl2ijX5BQkfOdboYXV+EvKP1MDlRzbzQkZqcAMpyKcuvv6 6sGQUAUzNm0JMEKQt3rU+fY5fAG7kVofHaWG4BrhPZTAyOd7dDttDSQMrSV9jmTyk8ta WdFQ== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@berkeley.edu header.s=google header.b=pTzlfp5l; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=berkeley.edu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=sender:from:to:subject:in-reply-to:references:date:message-id :mime-version:x-original-sender:x-original-authentication-results :reply-to:precedence:mailing-list:list-id:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=+K3p3Q3Adp9+DbUGh4xM7SIZgwCwfCjzicZKm2RDqHA=; b=siaDbLiuIsIJpnh/9rZIwGdzR9gUlpdNAmBoooADcDUV00VyvI5TbZwUFLb9YvEOTA DvR/hzPbMCq8OfnsKJ+HyllFZkBqsdnYbKFsL6DsYgM6I+SrEIGaewmbdy5acS3TVe0I 70jW3UxiOc79gE2CRbPVn1HUOMQnjfN+9fgoytUsXxBq/DjmJLvRjjhKeTJwEW1qZAtT dsniCdP5yAVXv9BoM+qfrIJEY7tzkl0/WgTODiVtut5Q9JzFq98b2y9ALIDeHXwHvhfJ nJiWBg6xtEhaiLVbj1Qn/sIkU9Qayvi5rwuBN1cpH0IDm/mkQP8Vg5qVNQTKiRd34i7V Lm7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=sender:x-gm-message-state:from:to:subject:in-reply-to:references :date:message-id:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-spam-checked-in-group:list-post:list-help:list-archive :list-subscribe:list-unsubscribe; bh=+K3p3Q3Adp9+DbUGh4xM7SIZgwCwfCjzicZKm2RDqHA=; b=6FoCXRwIHu2M8oiUYAPg0bo0Hnfv6OCtXFJC3cemmkpl53SkzDL0O9BxrtyqNpWsSE RSqoA1n8cdg/DhY9if3uSyIRWb28hSrEBLxRqTDompOyTpvbCBsDK+6CLxEjQHw2iYew IQutcMWgkH+hloaXJzOICaC/EOVp4COD4Bjwj63ElKMoUxAAQCG4WztRo1XvFTIaRjih TTnt4QckqB6g9YOo4Ux65FFnZyRlWeh8n2sNI0sd21LeOmv4/KO9rPQKSa8dLxtgeki9 /c0ttbjXbBeJMGrECtEHevdkN8NaxFhkc+zQ9sDI9tYOSuk4U25lj7GDUybWSoZbi9iF sLCw== Original-Sender: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org X-Gm-Message-State: AJIora8vnx4kY6yoiW7mlSyCpeZpcEgqy7nPCQtKVSNl/c1UMfxnuim+ ndNDIES/7lGY6iNza9WsObw= X-Google-Smtp-Source: AGRyM1slnwkHvI97gV8iggJ93lOr3kf0mPx6eIKt7+zdhcgqW8ZMtjHBFgxJW7CKmIIDJxFJnlICUA== X-Received: by 2002:a05:6808:d4c:b0:32f:361d:638f with SMTP id w12-20020a0568080d4c00b0032f361d638fmr1105120oik.100.1655332578164; Wed, 15 Jun 2022 15:36:18 -0700 (PDT) X-BeenThere: pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Original-Received: by 2002:a05:6870:bace:b0:fe:29a0:4b41 with SMTP id js14-20020a056870bace00b000fe29a04b41ls14346oab.11.gmail; Wed, 15 Jun 2022 15:36:15 -0700 (PDT) X-Received: by 2002:a05:6871:91:b0:fe:1977:afb9 with SMTP id u17-20020a056871009100b000fe1977afb9mr1089768oaa.83.1655332575676; Wed, 15 Jun 2022 15:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655332575; cv=none; d=google.com; s=arc-20160816; b=joHD3gF+H08X7TseFGWmTrATY3+iJBI1RSE6JHuDOxLppKgI/OTkgwgCxQ4DZannml jiOdNK29L12h7jZA7AnvcpUVuKmETGfnAPjP/rdt6Zeh2i/3AroTIPoarwatExQ8ukT2 jI48PZ23PHJUa0/f7nb2J3FnpL4VXgIDEKIjtq7CZFrd0Zvy4zF3vMn24GdESgEpbleB 37VDMtr0TxGSMAzkKNsBXrYKqjplslBXvp2pS/mULk+uU5ygDq1KQQDWEsikdZTEW386 xMk8atCEzRLlR8CR3ua1v8dfCXp0SYibcA4G7pWptLrSi6bKZdi159L5GLd9WhsxSJXZ ZvAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :dkim-signature; bh=M8HwqUXHSZihC8gXbVmr3lW9T9ANK7TkvyDKV6MedPE=; b=F6M0gGiVlU2hf7JwxJ/C+KRaLsNa8em5ykbA3Fuxa4zMMsSTGTUvUYDgObyfzQgGVU Tex31e3vQqqTAe26hRFpEWdMVhQbsRvEWC7mbEcmUHPU3vycOR98vTs67Zjnv+Xik5wq uD+I6hWqIPGV1zj93zs3zlWu72r5OsrSZ7hAHgRgahjsa3HMDCIeA0vxd2Gz6QL+Dfnu jd6GedGN+P4vwbY2kouiyvQINAi/TgpRj7Q0mc00FhW/dTFajGViPVvTyzr+rxOZZ0i0 /DM9StOnqFvRfVQzWk/tsSKFxj7iCrYlBu86FGASui892u0zUygV/ajRU1XWKMU4FT3m udEg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@berkeley.edu header.s=google header.b=pTzlfp5l; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=berkeley.edu Original-Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com. [2607:f8b0:4864:20::62d]) by gmr-mx.google.com with ESMTPS id bd23-20020a056808221700b0032f15fa78efsi467oib.4.2022.06.15.15.36.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Jun 2022 15:36:15 -0700 (PDT) Received-SPF: pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62d as permitted sender) client-ip=2607:f8b0:4864:20::62d; Original-Received: by mail-pl1-x62d.google.com with SMTP id m14so1196071plg.5 for ; Wed, 15 Jun 2022 15:36:15 -0700 (PDT) X-Received: by 2002:a17:902:6946:b0:167:8ff3:1608 with SMTP id k6-20020a170902694600b001678ff31608mr1895896plt.116.1655332575006; Wed, 15 Jun 2022 15:36:15 -0700 (PDT) Original-Received: from hermes.johnmacfarlane.net ([45.32.92.108]) by smtp.gmail.com with ESMTPSA id k7-20020a170902d58700b0016403cae7desm116040plh.276.2022.06.15.15.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jun 2022 15:36:14 -0700 (PDT) Original-Received: by hermes.johnmacfarlane.net (sSMTP sendmail emulation); Wed, 15 Jun 2022 15:36:11 -0700 In-Reply-To: X-Original-Sender: jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@berkeley.edu header.s=google header.b=pTzlfp5l; spf=pass (google.com: domain of jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org designates 2607:f8b0:4864:20::62d as permitted sender) smtp.mailfrom=jgm-TVLZxgkOlNX2fBVCVOL8/A@public.gmane.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=berkeley.edu Precedence: list Mailing-list: list pandoc-discuss-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org; contact pandoc-discuss+owners-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org List-ID: X-Google-Group-Id: 1007024079513 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , Xref: news.gmane.io gmane.text.pandoc:30736 Archived-At: Noah Malmed writes: > Hello! > > We use Pandoc often to convert from docx to HTML, and many of the > documents we convert include tables. As far as we can tell, almost all of > the table styling is lost in the docx reader. Specifically, we care about 5 > things: > > 1. Text justification (left, center, or right) > > 2. Vertical alignment (top, middle, or bottom) > > 3. Text indentation > > 4. Cell shading and text color > > 5. Table borders > > We hope to enhance the docx reader so that these stylings get preserved in > the AST. > > Proposed solutions: > > 1. It seems like text justification already exists in the AST through the > Alignment value. It just needs to get implemented in the docx reader, as > described in this issue: https://github.com/jgm/pandoc/issues/6316 Correct. > 2. Add the vertical alignment style to attributes as suggested here > Should be okay. However, adding `vertical-align` there won't do any good for converting to HTML unless the HTML writer is modified to be sensitive to this attribute. > 3. Add text indentation to attributes in the form of the style padding-left You're talking about directly adding 'style' to attributes, with CSS contents? That would make the docx reader very good for converting to HTML and not so good for any other format. Note that in general pandoc does not strive to preserve every small detail of formatting, only structure. See the beginning of the manual. > 4. Add cell shading and text color to attributes in the form of the styles > background-color and color See above, also search the issue tracker for 'color'. > 5. Add table borders to attributes in the form of the style border I think this falls into the category of things that are beyond pandoc's scope. We don't strive to reproduce all the formatting details in conversions. Again, see the beginning of the manual.