From patchwork Tue May 28 14:06:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13676832 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF76013A868 for ; Tue, 28 May 2024 14:07:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905231; cv=none; b=owgAF6sEs42CdxsK14319+OQXrD6I4FzzUl/x/CG5gFV6qkvsYnNrMrJaN4MFzHsZZVloFg+0NVqAZ6kRiiLP7zcd7h57pHvUiqLx9ZNvMvlqxNfmWtCFi31Mxl0C/KxwRliYQUyW+9KctYb4NEarVBhMoLxDYAPtJyUfEuDsMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905231; c=relaxed/simple; bh=MQ69LtO8M9cLzn0g2HkeRYi0wMGIyWZAesPUuWLZEuI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=khBA+tgn7MasbOGPVykKMK9KubBJyWnUdpEhLYPvdVAN1BNRVgs3jALvkIhlHM1KUGovJ4jzlAPXWUvosyvDR4EjQqvB6Vy49gcpZM3Ewm236eDSRCHWeWqScyJTIKn2zlI2joABhNO3I+ApjDeUIHXZylmfwm4X6zi7jtAM54s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=IjovwpFH; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IjovwpFH" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4210c9d1df6so6814245e9.2 for ; Tue, 28 May 2024 07:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716905227; x=1717510027; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DJYiy2bAj2FaSa/bOXOAtiypNP4pZBgAgYRKiJ5X6fA=; b=IjovwpFHFb5jIGRdebaMXFfmZYWqZsg1Rr93xvEMq3r5yaNPzI+7XhEY2eHILxFlaL S1a0/V6ZPu3M7QVttcfVeCsvlVFoUy95/w5X8RQvc2eW2qs+xIhGYCBzqqDVM5GBsOCC HvdUYPUtYVSJIsn0q5zUbRELHLaQPhBvMhmmOErJb/2YJ7undJC3xlw9T7OZgSI/OyED r6kH32oe7IStOmDjYZvR3ApgRYhMFUAhXDx90vg/MEMLg8v8XFwWzK2xh3i9lcEyY7Wo buMoCa0rNny8/CbEaGpYyOmLx7CmI5/S1SWC/i5RwFtQYIDMiWPkyZvgPc8YPODLvl22 upZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716905227; x=1717510027; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DJYiy2bAj2FaSa/bOXOAtiypNP4pZBgAgYRKiJ5X6fA=; b=rGUxLReE6DYbzNB7/JDn5Vn0FbJ/3VGN5ZLgRYSRv13h+zxgow/9Y8GcXqF4YL4tj8 tXYZ+0UfQU5qXBrYpI/LipGzJA4GfqWyPRVTrNg3Aupyzibyq3pSbAnvsGrX06iGWcsE KJByZi4+Q1aMPugDCWlS+pZYvTsA8bp8TI7dO0WJfXJCkrthHI5Lx9cheuX2r+1gZaPu 1ivAqh5UfrCmhxt+ZToepy7+1CVNATeWkkT+0HcCVgNvNX2bY0WQCnBvW3IlOLCkUr0C SKjBd8ZkjfNiOVRJr0knsTcxbJEWb/xkXWwlbdQ6NkUQbOYLzr2bY3bS9pU6ouqA32JZ qNAQ== X-Gm-Message-State: AOJu0YzlEKkKG0TngHwUMdH48M1UnwrISAzTVLppt/s5CQ3g4hBDNsW0 z603PiiLAmXdUAq3yAuSrfz6ZKK4LnVaW/7qX2vpr9DD8JQA5t4ut1Duo5+W X-Google-Smtp-Source: AGHT+IHD8zd3830z60+a3DaVlpCND8JnPsxF70jXBuF3KgUBGyBVdy2+jwHoi9wftibRjz7ONYNOeg== X-Received: by 2002:a05:600c:19ce:b0:421:1206:2645 with SMTP id 5b1f17b1804b1-421120627f6mr54036325e9.5.1716905227094; Tue, 28 May 2024 07:07:07 -0700 (PDT) Received: from imac.fritz.box ([2a02:8010:60a0:0:68e9:662a:6a81:de0a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-359efaf5402sm4534599f8f.78.2024.05.28.07.07.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 07:07:04 -0700 (PDT) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jiri Pirko , Breno Leitao , Arkadiusz Kubalewski , Vadim Fedorenko Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v1 1/4] doc: netlink: Fix generated .rst for multi-line docs Date: Tue, 28 May 2024 15:06:49 +0100 Message-ID: <20240528140652.9445-2-donald.hunter@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528140652.9445-1-donald.hunter@gmail.com> References: <20240528140652.9445-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Fix the newline replacement in ynl-gen-rst.py to put spaces between concatenated lines. This fixes the broken doc string formatting. See the dpll docs for an example of broken concatenation: https://docs.kernel.org/6.9/networking/netlink_spec/dpll.html#lock-status Signed-off-by: Donald Hunter --- tools/net/ynl/ynl-gen-rst.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py index 657e881d2ea4..5c7465d6befa 100755 --- a/tools/net/ynl/ynl-gen-rst.py +++ b/tools/net/ynl/ynl-gen-rst.py @@ -49,7 +49,7 @@ def inline(text: str) -> str: def sanitize(text: str) -> str: """Remove newlines and multiple spaces""" # This is useful for some fields that are spread across multiple lines - return str(text).replace("\n", "").strip() + return str(text).replace("\n", " ").strip() def rst_fields(key: str, value: str, level: int = 0) -> str: From patchwork Tue May 28 14:06:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13676833 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36CE316F826 for ; Tue, 28 May 2024 14:07:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905231; cv=none; b=XwMTI1gbhT3Ms1BuMkz7Bou9AaftqRf7Fp93imSvM7paXal+ejQDly2aGxWSXb23EU1l1sKa2Sb1ItLfIn7j0+WVSqR6kYPCZOxrZUPZIoHRMJUV8ZJ3rR4LfeOtxja2fA/tm2m/sGtf/DperQPR5kZUoeL+6P5DTmL4QES5P90= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905231; c=relaxed/simple; bh=kdWY1md+Cnz1PlyvFWi4xZHNlbTD9PJAG5QXiKfnYPI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZZv/EBweXt6xgqeJjT6KzejTgqlh7gnZ1hT1wMoVtrCWRMWACoq44eKgM1+RuP0AOhzEjzkkjdsSqHUzuAVhS3KJAm3m7lW4xIkedgHEs0ULuxo3DUCUM0+xkeMKnygSl22aZJUQ6Uu+JMXboId2H5Lh0+Z/2sbEwZjDdFvzkBo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=diowS6Fi; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="diowS6Fi" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-42108856c33so23485765e9.1 for ; Tue, 28 May 2024 07:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716905228; x=1717510028; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sLkiSiRrSAnOAs3Y6h5iMAoW3bCpoNjxPw0wPZ+lU14=; b=diowS6FiDBhSgKuTdaUuPTDqABpwYak37m59zxNGhY/IT9/XGZmeUNIJMLy5QFIVyh BhnPW6nBbXC3cqQwmY56Wvzjcs8kWdDjczE7WM1iUYyPdv61p786fAypDdcOl20RB8vj Ru2b+nG5rDg1OlJGiR4oUcAJQYGNkToMGWjh6qsuPUNEDACf/EjoxQuL+ZTHLUfe6FMc p2w0N6aHzI5cqcOnHFoXoObYRcrfEvfjl3WQkhzLQg1/yJ3wuhpALwnBSloAkY2xMv0M sU9KL3Kw7gIsRIc5X4mVP9yH5FV6l6OevJOvm68Nu4bneqFh/YSLEAoHFG5jP2GbTlYY y36w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716905228; x=1717510028; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sLkiSiRrSAnOAs3Y6h5iMAoW3bCpoNjxPw0wPZ+lU14=; b=OAGhbgJQwV4xyoyF2at+7ip3LQv9174zgNQF8D+u+FSyDBXUcyorFT0inooO6aG1gW DrnTdaVLbxETDrn1PTTdQkfGYwCnQwbIQld0/fsewIQKo1qgB+9TQwkx0hAqgFmYPWTd QXGz4yi+BTp/nD0X1pRCnFJx5xQY70V4LYEfGcMxXqVZtisBXL+xcUjwgmBihEpdv3yI i1l+Z9NcI6Ru2t+05n0oIGFUYp3cibP7J5J7LiR8RjsOih8hRWDhMmP0RO32Lid7uT0R xTZ6IA155RzEzSMyCY+lpS4c523YlsGrxCYRWRelhioWe0GUEZqCv2egqY93jyokQuVx F7Jg== X-Gm-Message-State: AOJu0YyOFXe95dQ7LbJOX5XNixf+i10uZkG8umeladIDlK20yha0ykOL wtyNEI6IxbXuFTqerf/PlOfVd0VLUA97zVQCAfwkLIOUv8vLD1+/qRxaMRU0 X-Google-Smtp-Source: AGHT+IEhXkpj51ZifiR25DYyGuchZ/W7P6QHJ62qqcftuUbXfQg8NXe4YOdQv/ClQq/lhxAYXo9rEA== X-Received: by 2002:a05:600c:450a:b0:41a:8035:af77 with SMTP id 5b1f17b1804b1-421015c7259mr129966985e9.12.1716905228139; Tue, 28 May 2024 07:07:08 -0700 (PDT) Received: from imac.fritz.box ([2a02:8010:60a0:0:68e9:662a:6a81:de0a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-359efaf5402sm4534599f8f.78.2024.05.28.07.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 07:07:07 -0700 (PDT) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jiri Pirko , Breno Leitao , Arkadiusz Kubalewski , Vadim Fedorenko Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v1 2/4] doc: netlink: Don't 'sanitize' op docstrings in generated .rst Date: Tue, 28 May 2024 15:06:50 +0100 Message-ID: <20240528140652.9445-3-donald.hunter@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528140652.9445-1-donald.hunter@gmail.com> References: <20240528140652.9445-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The doc strings for do/dump ops are emitted as toplevel .rst constructs so they can be multi-line. Pass multi-line text straight through to the .rst to retain any simple formatting from the .yaml This fixes e.g. list formatting for the pin-get docs in dpll.yaml: https://docs.kernel.org/6.9/networking/netlink_spec/dpll.html#pin-get Signed-off-by: Donald Hunter --- Documentation/netlink/specs/dpll.yaml | 1 + tools/net/ynl/ynl-gen-rst.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/netlink/specs/dpll.yaml b/Documentation/netlink/specs/dpll.yaml index 95b0eb1486bf..94132d30e0e0 100644 --- a/Documentation/netlink/specs/dpll.yaml +++ b/Documentation/netlink/specs/dpll.yaml @@ -479,6 +479,7 @@ operations: name: pin-get doc: | Get list of pins and its attributes. + - dump request without any attributes given - list all the pins in the system - dump request with target dpll - list all the pins registered with diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py index 5c7465d6befa..1096a71d7867 100755 --- a/tools/net/ynl/ynl-gen-rst.py +++ b/tools/net/ynl/ynl-gen-rst.py @@ -178,7 +178,7 @@ def parse_operations(operations: List[Dict[str, Any]], namespace: str) -> str: for operation in operations: lines.append(rst_section(namespace, 'operation', operation["name"])) - lines.append(rst_paragraph(sanitize(operation["doc"])) + "\n") + lines.append(rst_paragraph(operation["doc"]) + "\n") for key in operation.keys(): if key in preprocessed: From patchwork Tue May 28 14:06:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13676834 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 158E316F839 for ; Tue, 28 May 2024 14:07:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905233; cv=none; b=SSVomAX+25OuVTMcFAH8/InwHsHf9SnsU9Ogon0tvgd/Co40x7p3pU3G6vN57b/JRSY8pd91ogkvTT9/cILWjknP0QfbLroYmj8OEqT8TDJemvR7k2U5rJM4v29knnGqBYxN8MUvNY26oGjnGu9+Jj48HaXZfmng6YSYZyCvt4Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905233; c=relaxed/simple; bh=RaTuZqpnMLUFacKJseAeTCJlX52CiEWM4nZjZsy2uFU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hHLr8JPyH7XXryZCFKrRq2KmxzETqErE6rN8n/iE0U6qRNNQrv+jMu+zDXEQggp8VS2jzCtaEjDxqtfr3QbxWF+8bsBf/9MbT0MUeKHvLjRrKilBaTY3YSNZiXZ688VxIIbVMwbXPrzf1x4qCYxi4+2zJZGQslpmYW7RUsWpm9w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VnLY5ZUZ; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VnLY5ZUZ" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2e724bc46bfso9190751fa.3 for ; Tue, 28 May 2024 07:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716905230; x=1717510030; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cVmb9sP8GIUblthAc/eDiBYyoygYmdyWG7iTsuFrm+Y=; b=VnLY5ZUZEkz+FRaCsW4PdsCG7oRR6pyuCREPMjZmRSXVtamOzTj3EmJmQbl9U6T0x2 C9mZYHL5nN6oHMbp0dCt0+yLn6uMOG9XNVCVn8xUV6W9XcyqS1R27OWs1I+bnUSQ/uvN zuvPRjzbkabmqZpj7sWKzUvHHJ0AfFR8AxrvyHi0pACHIm22SvaxbI4hXGaWDM0AFmUQ j9cYRNTDqejP3Au2g3y+dHMxqr3OnknA07FDZbvJ+Bk4gVdSHPNhHR4whq2w1MzM95ab cwL1NmEV88EGCSMbEhfuMRfHOagqzzffZ+JXBy8R0+nqBrXq5PZ0GXVkxfWy8YV0Rz91 8ZfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716905230; x=1717510030; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cVmb9sP8GIUblthAc/eDiBYyoygYmdyWG7iTsuFrm+Y=; b=nKHuyUwekW2Egkfx74OYEcyUsDer9yBOERUfe/FezM/DAdWlhBXUDkA1S8VcPLkrn0 QJrItI1JbMTP2BTfJyjl8rUCA8a6c01TXH2CTdrXB2izSKKKw/kf2mAwuT0l8hHNfMEh EsXfT7Om5ZqR3nbbGWsj1amJo7H0SIhV1aKXCdzfR0Zu9zWD3uXk/4XuWbSlclQxmbS9 PhlYpuoycDuHm6SfiIcDgCwtFfzLWZswcv2JjNX+yUnjr2B8s+StW2EYNNFeQBkAEfIS X5K46lSBX60JSePICcbGG8qi9x6EhgfMhKLm5p6SxmiQdFZUeMuY4zf4GK6Ti+FheQMS 2lsw== X-Gm-Message-State: AOJu0YxFa48U9WurCLXnkRrqEDbSEMt2JimmVxBq5vMQ2a8nBEGABlMB 8eW1M+TVoR/3Ti+sMszK+iLKiQ1NTA1TnoqIK+1nP9Qy+wDEhYa0sSwwieo0 X-Google-Smtp-Source: AGHT+IHF0n0RpvDNsdtGlvl7PkBU87jLheGfy+amsVegWhG2KbXS3phfkipg7Mtp4L1iZalCZMzTQg== X-Received: by 2002:a2e:a593:0:b0:2e4:f8e:3a64 with SMTP id 38308e7fff4ca-2e95b0bd93bmr86166581fa.30.1716905229421; Tue, 28 May 2024 07:07:09 -0700 (PDT) Received: from imac.fritz.box ([2a02:8010:60a0:0:68e9:662a:6a81:de0a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-359efaf5402sm4534599f8f.78.2024.05.28.07.07.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 07:07:08 -0700 (PDT) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jiri Pirko , Breno Leitao , Arkadiusz Kubalewski , Vadim Fedorenko Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v1 3/4] doc: netlink: Fix formatting of op flags in generated .rst Date: Tue, 28 May 2024 15:06:51 +0100 Message-ID: <20240528140652.9445-4-donald.hunter@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528140652.9445-1-donald.hunter@gmail.com> References: <20240528140652.9445-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Generate op flags as an inline list instead of a stringified python value. Signed-off-by: Donald Hunter --- tools/net/ynl/ynl-gen-rst.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py index 1096a71d7867..a957725b20dc 100755 --- a/tools/net/ynl/ynl-gen-rst.py +++ b/tools/net/ynl/ynl-gen-rst.py @@ -172,7 +172,7 @@ def parse_do_attributes(attrs: Dict[str, Any], level: int = 0) -> str: def parse_operations(operations: List[Dict[str, Any]], namespace: str) -> str: """Parse operations block""" - preprocessed = ["name", "doc", "title", "do", "dump"] + preprocessed = ["name", "doc", "title", "do", "dump", "flags"] linkable = ["fixed-header", "attribute-set"] lines = [] @@ -188,6 +188,8 @@ def parse_operations(operations: List[Dict[str, Any]], namespace: str) -> str: if key in linkable: value = rst_ref(namespace, key, value) lines.append(rst_fields(key, value, 0)) + if 'flags' in operation: + lines.append(rst_fields('flags', rst_list_inline(operation['flags']))) if "do" in operation: lines.append(rst_paragraph(":do:", 0)) From patchwork Tue May 28 14:06:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13676835 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A9EC16F844 for ; Tue, 28 May 2024 14:07:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905233; cv=none; b=VGphN7tGuCMwlS+R1L31Z2Yb7nRNy+XsrDCt1HmQXpoz9xvF6bUINGFSoUve87GmwtyZ8uPlK+ugsj8b1JVnpowjetNBCyEKoEbgAsAEbFoaLI4I2sc7PMViRUcrbzuq6w20g17Fas+7KGNUpeog4upecEzoOVz00gFGbAj2kNk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716905233; c=relaxed/simple; bh=7AWlqIz31VH+2auWG19awNf9Ol79+gqyQMhVO5xC260=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fWbZvp25goGs2rNCGFVrtXyXhyH+xW6/sL51X7eG17hEAZWIWKjoI5Fwxa1odv8C04U3GHTIFI87p3fOPTJFbwJ1ysnUomti29bcHV8Z5lHlM/SnKm5HSwhxCZleFYGXO3qrhIqp35ViYf1zLy/rX2Hx0XEH1reYrMCdp5SK4SU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=S2HbvMn8; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="S2HbvMn8" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-356c4e926a3so674652f8f.1 for ; Tue, 28 May 2024 07:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1716905230; x=1717510030; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=p/eRqqpRId2hU8uhh2VGbfYucEQw3R2tB8HH0TtVdKk=; b=S2HbvMn8Z+HOmzw1V9TCdk5e8+Ql+RJtxCpqWrJX/46J2tG+KkIylY5kxk9ryjRtbZ DX1DO7LIDKLhb61FvNOTO+hLWOzFDUOPCSUFV0k8BSf2NfH3pLMLw9Ecd0nxhOfwqvai P2dQvztJ9XcpsMskRVAfy4mwGEuJVEPSCidma4iuT0KHdGrGvz8xnOEr8tK53jhZ889p uGupSpIE9jBf2lSOlzcFC3kY6OF8NhQe71t/YaONx6KDth8LyZGMfVWG7AQWf0YZBumY WH22cGr0vVxVboJ6M1oGWf5zR1C9/tex96kt4tRg2xRQkxhXicPdBpABllnRP5TJrHxY HWOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716905230; x=1717510030; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=p/eRqqpRId2hU8uhh2VGbfYucEQw3R2tB8HH0TtVdKk=; b=Gxssjw79UNxzuGW0FECGZMRR6sByLuEyYTThj3WytSs1lUHW/DK2RgTPPfx0YTBcXO 7QF0V5fNKg7vpwzbGZAbfLQQrRwqOkhdvl/GgEidD4tcCCyO9ojG13AfQxV5FdlBAQbr H5OWIFe9MCtiNjKHsLLpqAsoAK+ALuDcxdCWqUKqJVRZXHV3I7UhIILzuZd3mGSJUOT/ 6poxU3kix9FaRyNnvMSd4j+/ajO/TGbyQGiNDztT4J0KVM2/CkCjsAn1sVuz/BC0sQP2 ZWWzq/cg3Itl6bc+G0OHEdTol5QiPRVwaSkS9jKYBhWmudK8JEJpvgmXwaEM0AkX5TWn cKpA== X-Gm-Message-State: AOJu0Yz555HyhzhXvTydL2s9Y1v+hApVReiJQ1xqyG1Pg7pHceFW6yhE VND70nqxOq51dboWJeYGQGNN1RKp98Sh0VCBYHJ3Rtav2Pz71mUY2EEthST7 X-Google-Smtp-Source: AGHT+IHidcE/qhSjftJB9oR4DkKrzsL4D5WztX9yJYsc7j0RFawFNV/ukEEkH6RMcqad3eBdXT3CUA== X-Received: by 2002:a5d:4f8b:0:b0:34f:5d07:ebd1 with SMTP id ffacd0b85a97d-3552fdf2397mr8705503f8f.56.1716905230391; Tue, 28 May 2024 07:07:10 -0700 (PDT) Received: from imac.fritz.box ([2a02:8010:60a0:0:68e9:662a:6a81:de0a]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-359efaf5402sm4534599f8f.78.2024.05.28.07.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 07:07:10 -0700 (PDT) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Jiri Pirko , Breno Leitao , Arkadiusz Kubalewski , Vadim Fedorenko Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v1 4/4] doc: netlink: Fix op pre and post fields in generated .rst Date: Tue, 28 May 2024 15:06:52 +0100 Message-ID: <20240528140652.9445-5-donald.hunter@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240528140652.9445-1-donald.hunter@gmail.com> References: <20240528140652.9445-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org The generated .rst has pre and post headings without any values, e.g. here: https://docs.kernel.org/6.9/networking/netlink_spec/dpll.html#device-id-get Emit keys and values in the generated .rst Signed-off-by: Donald Hunter --- tools/net/ynl/ynl-gen-rst.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/net/ynl/ynl-gen-rst.py b/tools/net/ynl/ynl-gen-rst.py index a957725b20dc..6c56d0d726b4 100755 --- a/tools/net/ynl/ynl-gen-rst.py +++ b/tools/net/ynl/ynl-gen-rst.py @@ -156,7 +156,10 @@ def parse_do(do_dict: Dict[str, Any], level: int = 0) -> str: lines = [] for key in do_dict.keys(): lines.append(rst_paragraph(bold(key), level + 1)) - lines.append(parse_do_attributes(do_dict[key], level + 1) + "\n") + if key in ['request', 'reply']: + lines.append(parse_do_attributes(do_dict[key], level + 1) + "\n") + else: + lines.append(headroom(level + 2) + do_dict[key] + "\n") return "\n".join(lines)